DBG: move same debugln to LazLogger cmd-line config

git-svn-id: trunk@35342 -
This commit is contained in:
martin 2012-02-12 23:33:11 +00:00
parent a012396166
commit fcdd4f6bf0
3 changed files with 23 additions and 27 deletions

View File

@ -2970,7 +2970,8 @@ function HasConsoleSupport: Boolean;
implementation
var
DBG_STATE, DBG_EVENTS, DBG_STATE_EVENT, DBG_DATA_MONITORS: PLazLoggerLogGroup;
DBG_STATE, DBG_EVENTS, DBG_STATE_EVENT,
DBG_DATA_MONITORS, DBG_LOCATION_INFO: PLazLoggerLogGroup;
const
COMMANDMAP: array[TDBGState] of TDBGCommands = (
@ -3370,18 +3371,14 @@ begin
i := FList.Count - 1;
while i >= 0 do begin
if FList[i].IsEqual(AFileName, AFullFileName) then begin
{$IFDEF DBG_LOCATION_INFO}
debugln(['TDebuggerLocationProvider.GetLocationInfoFor Found entry for: ', AFileName, ' / ', AFullFileName]);
{$ENDIF}
debugln(DBG_LOCATION_INFO, ['TDebuggerLocationProvider.GetLocationInfoFor Found entry for: ', AFileName, ' / ', AFullFileName]);
exit(FList[i])
end;
dec(i);
end;
Result := TDebuggerUnitInfo.Create(AFileName, AFullFileName);
FList.Add(Result);
{$IFDEF DBG_LOCATION_INFO}
debugln(['TDebuggerLocationProvider.GetLocationInfoFor Created new entry (Cnt=',FList.Count,') for: ', AFileName, ' / ', AFullFileName]);
{$ENDIF}
debugln(DBG_LOCATION_INFO, ['TDebuggerLocationProvider.GetLocationInfoFor Created new entry (Cnt=',FList.Count,') for: ', AFileName, ' / ', AFullFileName]);
end;
function TDebuggerUnitInfoProvider.IndexOf(AnInfo: TDebuggerUnitInfo;
@ -11047,6 +11044,7 @@ initialization
DBG_EVENTS := DebugLogger.RegisterLogGroup('DBG_EVENTS' {$IFDEF DBG_EVENTS} , True {$ENDIF} );
DBG_STATE_EVENT := DebugLogger.RegisterLogGroup('DBG_STATE_EVENT' {$IFDEF DBG_STATE_EVENT} , True {$ENDIF} );
DBG_DATA_MONITORS := DebugLogger.FindOrRegisterLogGroup('DBG_DATA_MONITORS' {$IFDEF DBG_DATA_MONITORS} , True {$ENDIF} );
DBG_LOCATION_INFO := DebugLogger.FindOrRegisterLogGroup('DBG_LOCATION_INFO' {$IFDEF DBG_LOCATION_INFO} , True {$ENDIF} );
finalization
DoFinalization;

View File

@ -37,7 +37,7 @@ unit DebuggerDlg;
interface
uses
Classes, Forms, Controls, IDEProcs, FileUtil, LCLProc, Debugger,
Classes, Forms, Controls, IDEProcs, FileUtil, LCLProc, LazLogger, Debugger,
IDEImagesIntf, MainIntf, EditorOptions, IDECommands, BaseDebugManager;
type
@ -115,6 +115,7 @@ procedure CreateDebugDialog(Sender: TObject; aFormName: string;
implementation
var
DBG_LOCATION_INFO: PLazLoggerLogGroup;
BrkImgIdxInitialized: Boolean;
ImgBreakPoints: Array [0..8] of Integer;
@ -319,9 +320,7 @@ var
Filename: String;
ok: Boolean;
begin
{$IFDEF DBG_LOCATION_INFO}
debugln(['JumpToUnitSource AnUnitInfo=', AnUnitInfo.DebugText ]);
{$ENDIF}
debugln(DBG_LOCATION_INFO, ['JumpToUnitSource AnUnitInfo=', AnUnitInfo.DebugText ]);
// avoid any process-messages, so this proc can not be re-entered (avoid opening one files many times)
DebugBoss.LockCommandProcessing;
try
@ -330,9 +329,7 @@ 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}
debugln(DBG_LOCATION_INFO, ['JumpToUnitSource Filename=', Filename]);
ok := false;
if FilenameIsAbsolute(Filename) then
ok := MainIDEInterface.DoJumpToSourcePosition(Filename, 0, ALine, 0,
@ -485,4 +482,7 @@ procedure TDebuggerDlg.DoEndUpdate;
begin
end;
initialization
DBG_LOCATION_INFO := DebugLogger.FindOrRegisterLogGroup('DBG_LOCATION_INFO' {$IFDEF DBG_LOCATION_INFO} , True {$ENDIF} );
end.

View File

@ -42,7 +42,7 @@ uses
{$ENDIF}
// LCL
Classes, SysUtils, Forms, Controls, Dialogs, Menus, ExtCtrls, FileUtil, LCLProc,
LCLType, LCLIntf,
LCLType, LCLIntf, LazLogger,
// SynEdit, codetools
Laz_XMLCfg, SynEdit, CodeCache, CodeToolManager,
// IDEIntf
@ -238,6 +238,9 @@ type
implementation
var
DBG_LOCATION_INFO: PLazLoggerLogGroup;
type
{ TManagedBreakPoint }
@ -535,21 +538,15 @@ function TDebugManager.GetFullFilename(const AUnitinfo: TDebuggerUnitInfo;
begin
Filename := AUnitinfo.DbgFullName;
Result := Filename <> '';
{$IFDEF DBG_LOCATION_INFO}
debugln(['ResolveFromDbg Init Filename=', Filename]);
{$ENDIF}
debugln(DBG_LOCATION_INFO, ['ResolveFromDbg Init Filename=', Filename]);
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}
debugln(DBG_LOCATION_INFO, ['ResolveFromDbg 2nd Filename=', Filename]);
Result := GetFullFilename(Filename, AskUserIfNotFound);
end;
{$IFDEF DBG_LOCATION_INFO}
debugln(['ResolveFromDbg Final Filename=', Filename]);
{$ENDIF}
debugln(DBG_LOCATION_INFO, ['ResolveFromDbg Final Filename=', Filename]);
end;
begin
@ -571,9 +568,7 @@ begin
Filename:= MainIDE.FindSourceFile(Filename, Project1.ProjectDirectory,
[fsfSearchForProject, fsfUseIncludePaths, fsfUseDebugPath,
fsfMapTempToVirtualFiles, fsfSkipPackages]);
{$IFDEF DBG_LOCATION_INFO}
debugln(['GetFullFilename From-MainIDE Filename=', Filename]);
{$ENDIF}
debugln(DBG_LOCATION_INFO, ['GetFullFilename From-MainIDE Filename=', Filename]);
Result := Filename <> '';
if not Result then
ResolveFromDbg;
@ -2706,6 +2701,9 @@ begin
end;
end;
initialization
DBG_LOCATION_INFO := DebugLogger.FindOrRegisterLogGroup('DBG_LOCATION_INFO' {$IFDEF DBG_LOCATION_INFO} , True {$ENDIF} );
end.