DBG: added some feedback (debugln)

git-svn-id: trunk@33090 -
This commit is contained in:
martin 2011-10-26 14:26:14 +00:00
parent e9ccc22476
commit f991072664
3 changed files with 56 additions and 3 deletions

View File

@ -251,8 +251,9 @@ type
dltProject,
dltPackage
);
TDebuggerLocationFlags = set of (dlfLoadError // resolved but failed to load
);
TDebuggerLocationFlag = (dlfLoadError // resolved but failed to load
);
TDebuggerLocationFlags = set of TDebuggerLocationFlag;
{ TDebuggerUnitInfo }
@ -272,6 +273,7 @@ type
procedure SetLocationType(AValue: TDebuggerLocationType);
public
constructor Create(const AFileName: String; const AFullFileName: String);
function DebugText: String;
function IsEqual(const AFileName: String; const AFullFileName: String): boolean;
function IsEqual(AnOther: TDebuggerUnitInfo): boolean;
procedure LoadDataFromXMLConfig(const AConfig: TXMLConfig;
@ -2900,6 +2902,8 @@ function dbgs(ADataState: TDebuggerDataState): String; overload;
function dbgs(AKind: TDBGSymbolKind): String; overload;
function dbgs(AnAttribute: TDBGSymbolAttribute): String; overload;
function dbgs(AnAttributes: TDBGSymbolAttributes): String; overload;
function dbgs(AFlag: TDebuggerLocationFlag): String; overload;
function dbgs(AFlags: TDebuggerLocationFlags): String; overload;
function HasConsoleSupport: Boolean;
(******************************************************************************)
@ -2962,6 +2966,23 @@ begin
if Result <> '' then Result := '[' + Result + ']';
end;
function dbgs(AFlag: TDebuggerLocationFlag): String;
begin
writestr(Result, AFlag);
end;
function dbgs(AFlags: TDebuggerLocationFlags): String;
var
i: TDebuggerLocationFlag;
begin
for i := low(TDebuggerLocationFlags) to high(TDebuggerLocationFlags) do
if i in AFlags then begin
if Result <> '' then Result := Result + ', ';
Result := Result + dbgs(i);
end;
if Result <> '' then Result := '[' + Result + ']';
end;
function dbgs(ADisassRange: TDBGDisassemblerEntryRange): String; overload;
var
fo: Integer;
@ -3341,6 +3362,20 @@ begin
FLocationType := dltUnknown;
end;
function TDebuggerUnitInfo.DebugText: String;
var s: String;
begin
writestr(s, FLocationType);
Result
:= ' FileName="'+FFileName+'" '
+ 'DbgFullName="' + FDbgFullName+'" '
+ 'Flags="' + dbgs(FFlags)+'" '
+ 'LocationName="' + FLocationName+'" '
+ 'LocationOwnerName="' + FLocationOwnerName+'" '
+ 'LocationFullFile="' + FLocationFullFile+'" '
+ 'LocationType="' + s+'"';
end;
function TDebuggerUnitInfo.IsEqual(const AFileName: String;
const AFullFileName: String): boolean;
begin

View File

@ -37,7 +37,7 @@ unit DebuggerDlg;
interface
uses
Classes, Forms, Controls, IDEProcs, FileUtil, Debugger, EnvironmentOpts, IDEOptionDefs,
Classes, Forms, Controls, IDEProcs, FileUtil, LCLProc, Debugger, EnvironmentOpts, IDEOptionDefs,
IDEImagesIntf, MainIntf, EditorOptions, IDECommands, BaseDebugManager;
type
@ -310,6 +310,9 @@ var
Filename: String;
ok: Boolean;
begin
{$IFDEF DBG_LOCATION_INFO}
debugln(['JumpToUnitSource AnUnitInfo=', AnUnitInfo.DebugText ]);
{$ENDIF}
// avoid any process-messages, so this proc can not be re-entered (avoid opening one files many times)
DebugBoss.LockCommandProcessing;
try
@ -318,6 +321,9 @@ begin
*)
// TODO: better detcion of unsaved project files
if DebugBoss.GetFullFilename(AnUnitInfo, Filename, False) then begin
{$IFDEF DBG_LOCATION_INFO}
debugln(['JumpToUnitSource Filename=', Filename]);
{$ENDIF}
ok := false;
if FilenameIsAbsolute(Filename) then
ok := MainIDEIntf.DoJumpToSourcePosition(Filename, 0, ALine, 0,

View File

@ -538,12 +538,21 @@ function TDebugManager.GetFullFilename(const AUnitinfo: TDebuggerUnitInfo;
begin
Filename := AUnitinfo.DbgFullName;
Result := Filename <> '';
{$IFDEF DBG_LOCATION_INFO}
debugln(['ResolveFromDbg Init Filename=', Filename]);
{$ENDIF}
if Result then
Result := GetFullFilename(Filename, False);
if not Result then begin
Filename := AUnitinfo.FileName;
{$IFDEF DBG_LOCATION_INFO}
debugln(['ResolveFromDbg 2nd Filename=', Filename]);
{$ENDIF}
Result := GetFullFilename(Filename, AskUserIfNotFound);
end;
{$IFDEF DBG_LOCATION_INFO}
debugln(['ResolveFromDbg Final Filename=', Filename]);
{$ENDIF}
end;
begin
@ -565,6 +574,9 @@ begin
Filename:= MainIDE.FindSourceFile(Filename, Project1.ProjectDirectory,
[fsfSearchForProject, fsfUseIncludePaths, fsfUseDebugPath,
fsfMapTempToVirtualFiles, fsfSkipPackages]);
{$IFDEF DBG_LOCATION_INFO}
debugln(['GetFullFilename From-MainIDE Filename=', Filename]);
{$ENDIF}
Result := Filename <> '';
if not Result then
ResolveFromDbg;