diff --git a/components/dockedformeditor/source/dockedanchorcontrol.pas b/components/dockedformeditor/source/dockedanchorcontrol.pas index 51747c0e7a..5b7c08c7d6 100644 --- a/components/dockedformeditor/source/dockedanchorcontrol.pas +++ b/components/dockedformeditor/source/dockedanchorcontrol.pas @@ -21,6 +21,8 @@ uses // LCL Controls, ExtCtrls, Graphics, LCLProc, Dialogs, PairSplitter, ComCtrls, LCLType, IDEDialogs, + // LazUtils + LazLoggerBase, // DockedFormEditor DockedOptionsIDE, DockedStrConsts, DockedTools; @@ -240,7 +242,7 @@ end; procedure TAnchorControl.AnchorControlShowHint(Sender: TObject; HintInfo: PHintInfo); begin - HintInfo^.HintStr := 'Name [' + DbgSName(RootControl) + ']' + LineEnding + + HintInfo^.HintStr := 'Name [' + LazLoggerBase.DbgSName(RootControl) + ']' + LineEnding + 'Bounds [' + BoundsString + ']' + LineEnding + 'Align [' + DbgS(Align) + ']' + LineEnding + AnchorsString + diff --git a/components/dockedformeditor/source/dockedoptionside.pas b/components/dockedformeditor/source/dockedoptionside.pas index e05deb6dc6..79ee521182 100644 --- a/components/dockedformeditor/source/dockedoptionside.pas +++ b/components/dockedformeditor/source/dockedoptionside.pas @@ -17,7 +17,7 @@ uses // RTL Classes, SysUtils, // LazUtils - LazConfigStorage, LazFileUtils, LazFileCache, + LazConfigStorage, LazFileUtils, LazFileCache, LazLoggerBase, // LCL LCLProc, ComCtrls, Graphics, DockedStrConsts, // IdeIntf @@ -286,7 +286,7 @@ begin Modified := False; except on E: Exception do - DebugLn(['Error: (lazarus) [TDockedOptions.SaveSafe] ', E.Message]); + LazLoggerBase.DebugLn(['Error: (lazarus) [TDockedOptions.SaveSafe] ', E.Message]); end; end; @@ -296,7 +296,7 @@ begin LoadFromFile(DockedOptionsFileName); except on E: Exception do - DebugLn(['Error: (lazarus) [TDockedOptions.LoadSafe] ', E.Message]); + LazLoggerBase.DebugLn(['Error: (lazarus) [TDockedOptions.LoadSafe] ', E.Message]); end; Modified := False; end; diff --git a/components/dockedformeditor/source/dockedtools.pas b/components/dockedformeditor/source/dockedtools.pas index 908c42b3f7..52d3c98222 100644 --- a/components/dockedformeditor/source/dockedtools.pas +++ b/components/dockedformeditor/source/dockedtools.pas @@ -20,6 +20,8 @@ uses Classes, SysUtils, // LCL LCLProc, Forms, Controls, + //LazUtils + LazLoggerBase, // IDEIntf IDEMsgIntf, SrcEditorIntf, IDEExternToolIntf, // DockedFormEditor @@ -77,7 +79,7 @@ end; procedure IDEMessage(AString: String); begin - LCLProc.DebugLn(AString); + LazLoggerBase.DebugLn(AString); if Assigned(IDEMessagesWindow) then IDEMessagesWindow.AddCustomMessage(mluNone, AString, ''); end; diff --git a/ide/codecontextform.pas b/ide/codecontextform.pas index e3b12bac7b..00116365cf 100644 --- a/ide/codecontextform.pas +++ b/ide/codecontextform.pas @@ -42,7 +42,7 @@ uses LCLProc, LCLType, LCLIntf, LResources, LMessages, Forms, Controls, Graphics, Dialogs, Themes, Buttons, // LazUtils - LazStringUtils, GraphMath, + LazStringUtils, GraphMath, LazLoggerBase, // SynEdit SynEdit, SynEditKeyCmds, // CodeTools @@ -438,7 +438,7 @@ procedure TCodeContextFrm.CreateHints(const CodeContexts: TCodeContextInfo); Result:=true; end; if not Result then - debugln(['TCodeContextFrm.CreateHints.FindBaseType: not yet supported: ',ExprTypeToString(Expr)]); + LazLoggerBase.debugln(['TCodeContextFrm.CreateHints.FindBaseType: not yet supported: ',ExprTypeToString(Expr)]); except end; finally diff --git a/ide/codeexplorer.pas b/ide/codeexplorer.pas index 488d36b2f1..8bb738fd42 100644 --- a/ide/codeexplorer.pas +++ b/ide/codeexplorer.pas @@ -41,7 +41,7 @@ uses // RTL+FCL Classes, SysUtils, Types, AVL_Tree, // LazUtils - LazStringUtils, LazLoggerBase, + LazStringUtils, LazLoggerBase, LazTracer, // LCL LCLProc, LCLType, Forms, Controls, Dialogs, Buttons, ComCtrls, Menus, ExtCtrls, EditBtn, // CodeTools @@ -2055,7 +2055,7 @@ var CurPage: TCodeExplorerPage; begin if FUpdateCount<=0 then - RaiseGDBException('TCodeExplorerView.EndUpdate'); + LazTracer.RaiseGDBException('TCodeExplorerView.EndUpdate'); dec(FUpdateCount); if FUpdateCount=0 then begin CurPage:=CurrentPage; @@ -2942,7 +2942,7 @@ end; function TCodeObserverStatementState.Pop: TCodeObsStackItemType; begin if StackPtr=0 then - RaiseGDBException('inconsistency'); + LazTracer.RaiseGDBException('inconsistency'); dec(StackPtr); Result:=Stack[StackPtr].Typ; if IgnoreConstLevel>StackPtr then diff --git a/ide/fpdoceditwindow.pas b/ide/fpdoceditwindow.pas index e18a677ffd..10e686e69f 100644 --- a/ide/fpdoceditwindow.pas +++ b/ide/fpdoceditwindow.pas @@ -1228,7 +1228,7 @@ end; procedure TFPDocEditor.EndUpdate; begin dec(fUpdateLock); - if fUpdateLock<0 then RaiseGDBException(''); + if fUpdateLock<0 then LazTracer.RaiseGDBException(''); if fUpdateLock=0 then begin if fpdefCaptionNeedsUpdate in FFlags then UpdateCaption; end; diff --git a/ide/main.pp b/ide/main.pp index 557ecab9a4..491cdc45d6 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -71,7 +71,7 @@ uses // use lazutf8, lazfileutils and lazfilecache after FileProcs and FileUtil FileUtil, LazFileUtils, LazUtilities, LazUTF8, UTF8Process, LConvEncoding, Laz2_XMLCfg, LazLoggerBase, LazLogger, LazFileCache, AvgLvlTree, - GraphType, LazStringUtils, + GraphType, LazStringUtils, LazTracer, LCLExceptionStacktrace, {$IFDEF WINDOWS} Win32Proc, {$ENDIF} // SynEdit SynEdit, AllSynEdit, SynEditKeyCmds, SynEditMarks, SynEditHighlighter, @@ -6510,7 +6510,7 @@ begin AFilename:=ExpandFileNameUTF8(TrimFilename(AFilename)); //debugln('TMainIDE.DoOpenProjectFile A2 "'+AFileName+'"'); if not FilenameIsAbsolute(AFilename) then - RaiseGDBException('TMainIDE.DoOpenProjectFile: buggy ExpandFileNameUTF8'); + LazTracer.RaiseGDBException('TMainIDE.DoOpenProjectFile: buggy ExpandFileNameUTF8'); DiskFilename:=GetPhysicalFilenameCached(AFilename,false); if DiskFilename<>AFilename then begin // e.g. encoding changed @@ -8744,10 +8744,10 @@ begin ActiveUnitInfo:=nil; if AForm<>nil then begin if (AForm.Designer=nil) then - RaiseGDBException('TMainIDE.GetUnitWithForm AForm.Designer'); + LazTracer.RaiseGDBException('TMainIDE.GetUnitWithForm AForm.Designer'); AComponent:=AForm.Designer.LookupRoot; if AComponent=nil then - RaiseGDBException('TMainIDE.GetUnitWithForm AComponent=nil'); + LazTracer.RaiseGDBException('TMainIDE.GetUnitWithForm AComponent=nil'); GetUnitWithPersistent(AComponent,ActiveSourceEditor,ActiveUnitInfo); end; end; @@ -12016,7 +12016,7 @@ begin AComponent.Name,NewName,AComponent.ClassName,true); ApplyBossResult(lisUnableToRenameVariableInSource); end else begin - RaiseGDBException('TMainIDE.DesignerRenameComponent internal error:'+AComponent.Name+':'+AComponent.ClassName); + LazTracer.RaiseGDBException('TMainIDE.DesignerRenameComponent internal error:'+AComponent.Name+':'+AComponent.ClassName); end; // rename inherited components @@ -13026,7 +13026,7 @@ var begin AComponent:=ADesigner.LookupRoot; if AComponent=nil then - RaiseGDBException('TMainIDE.GetProjectFileWithDesigner Designer.LookupRoot=nil'); + LazTracer.RaiseGDBException('TMainIDE.GetProjectFileWithDesigner Designer.LookupRoot=nil'); Result:=GetProjectFileWithRootComponent(AComponent); end; @@ -13558,11 +13558,11 @@ begin if not BeginCodeTool(CurDesigner,SrcEdit,UnitInfo,[ctfSwitchToFormSource]) then exit; if CurDesigner.Form=nil then - RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: TDesigner without a form'); + LazTracer.RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: TDesigner without a form'); // find source for form Assert(UnitInfo=Project1.UnitWithComponent(CurDesigner.LookupRoot), 'TMainIDE.PropHookPersistentDeleting check fail.'); if UnitInfo=nil then - RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: form without source'); + LazTracer.RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: form without source'); // mark references modified MarkUnitsModifiedUsingSubComponent(Comp); // remember cursor position diff --git a/ide/packages/ideproject/project.pp b/ide/packages/ideproject/project.pp index ba8c6d38bf..054833598e 100644 --- a/ide/packages/ideproject/project.pp +++ b/ide/packages/ideproject/project.pp @@ -53,7 +53,7 @@ uses LinkScanner, CodeToolManager, CodeCache, CodeTree, StdCodeTools, // LazUtils FPCAdds, LazUtilities, FileUtil, LazFileUtils, LazFileCache, LazMethodList, - LazLoggerBase, FileReferenceList, LazUTF8, Laz2_XMLCfg, Maps, AvgLvlTree, + LazLoggerBase, LazTracer, FileReferenceList, LazUTF8, Laz2_XMLCfg, Maps, AvgLvlTree, // BuildIntf BaseIDEIntf, ProjectIntf, PackageIntf, MacroIntf, MacroDefIntf, CompOptsIntf, IDEOptionsIntf, @@ -2124,7 +2124,7 @@ end; procedure TUnitInfo.SetFilename(const AValue: string); begin if fSource<>nil then - RaiseGDBException('TUnitInfo.SetFilename Source<>nil') + LazTracer.RaiseGDBException('TUnitInfo.SetFilename Source<>nil') else SetInternalFilename(AValue); end; @@ -2324,8 +2324,8 @@ end; function TUnitInfo.AddRequiresComponentDependency(RequiredUnit: TUnitInfo; Types: TUnitCompDependencyTypes): TUnitComponentDependency; begin - if RequiredUnit=nil then RaiseGDBException('inconsistency'); - if RequiredUnit=Self then RaiseGDBException('inconsistency'); + if RequiredUnit=nil then LazTracer.RaiseGDBException('inconsistency'); + if RequiredUnit=Self then LazTracer.RaiseGDBException('inconsistency'); // search a dependency to this RequiredUnit Result:=FirstRequiredComponent; while Result<>nil do begin @@ -4068,7 +4068,7 @@ end; procedure TProject.EndUpdate; begin - if FUpdateLock<=0 then RaiseGDBException('TProject.EndUpdate'); + if FUpdateLock<=0 then LazTracer.RaiseGDBException('TProject.EndUpdate'); dec(FUpdateLock); FSourceDirectories.EndUpdate; FDefineTemplates.EndUpdate; @@ -4140,7 +4140,7 @@ end; procedure TProject.SetMainUnitID(const AValue: Integer); begin if AValue>=UnitCount then - RaiseGDBException(''); + LazTracer.RaiseGDBException(''); if MainUnitID=AValue then exit; if (MainUnitID>=0) and (MainUnitID