IdeDebugger: Move unit BaseDebugManager from Ide to IdeDebugger.

This commit is contained in:
Martin 2023-01-09 20:44:27 +01:00
parent 0395ecb8b9
commit e22f69d623
7 changed files with 37 additions and 41 deletions

View File

@ -210,10 +210,10 @@ type
procedure EnvironmentOptsChanged; override;
procedure LoadProjectSpecificInfo(XMLConfig: TXMLConfig;
Merge: boolean); override;
Merge: boolean);
procedure SaveProjectSpecificInfo(XMLConfig: TXMLConfig;
Flags: TProjectWriteFlags); override;
procedure DoRestoreDebuggerMarks(AnUnitInfo: TUnitInfo); override;
Flags: TProjectWriteFlags);
procedure DoRestoreDebuggerMarks(AnUnitInfo: TUnitInfo);
procedure ClearDebugOutputLog;
procedure ClearDebugEventsLog;
procedure DoBackendConverterChanged; override;
@ -275,8 +275,7 @@ type
function DoDeleteBreakPoint(const AFilename: string;
ALine: integer): TModalResult; override;
function DoDeleteBreakPointAtMark(
const ASourceMark: TSourceMark): TModalResult; override;
function DoDeleteBreakPointAtMark(const ASourceMarkObj: TObject): TModalResult; override;
function ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult; override;
function ShowWatchProperties(const AWatch: TCurrentWatch; AWatchExpression: String = ''): TModalresult; override;
@ -300,6 +299,10 @@ type
procedure UnregisterWatchesInvalidatedHandler(AHandler: TNotifyEvent); override;
end;
function GetDebugManager: TDebugManager;
property DebugBossMgr: TDebugManager read GetDebugManager;
function DBGDateTimeFormatter(const aValue: string): string;
implementation
@ -307,6 +310,11 @@ implementation
var
DBG_LOCATION_INFO: PLazLoggerLogGroup;
function GetDebugManager: TDebugManager;
begin
Result := TDebugManager(DebugBoss);
end;
function DBGDateTimeFormatter(const aValue: string): string;
var
FS: TFormatSettings;
@ -3105,15 +3113,17 @@ begin
end;
end;
function TDebugManager.DoDeleteBreakPointAtMark(const ASourceMark: TSourceMark
function TDebugManager.DoDeleteBreakPointAtMark(const ASourceMarkObj: TObject
): TModalResult;
var
OldBreakPoint: TIDEBreakPoint;
ASourceMark: TSourceMark absolute ASourceMarkObj;
begin
LockCommandProcessing;
try
// consistency check
if (ASourceMark=nil) or (not ASourceMark.IsBreakPoint)
if (ASourceMarkObj=nil) or (not (ASourceMarkObj is TSourceMark))
or (not ASourceMark.IsBreakPoint)
or (ASourceMark.Data=nil) or (not (ASourceMark.Data is TIDEBreakPoint)) then
RaiseGDBException('TDebugManager.DoDeleteBreakPointAtMark');

View File

@ -1365,11 +1365,6 @@
<IsPartOfProject Value="True"/>
<HasResources Value="True"/>
</Unit>
<Unit>
<Filename Value="basedebugmanager.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="BaseDebugManager"/>
</Unit>
<Unit>
<Filename Value="imexportcompileropts.pas"/>
<IsPartOfProject Value="True"/>

View File

@ -5697,7 +5697,7 @@ procedure TMainIDE.OnLoadProjectInfoFromXMLConfig(TheProject: TProject;
XMLConfig: TXMLConfig; Merge: boolean);
begin
if TheProject=Project1 then
DebugBoss.LoadProjectSpecificInfo(XMLConfig,Merge);
DebugBossMgr.LoadProjectSpecificInfo(XMLConfig,Merge);
if (TheProject=Project1) then
EditorMacroListViewer.LoadProjectSpecificInfo(XMLConfig);
@ -5720,7 +5720,7 @@ procedure TMainIDE.OnSaveProjectInfoToXMLConfig(TheProject: TProject;
XMLConfig: TXMLConfig; WriteFlags: TProjectWriteFlags);
begin
if (TheProject=Project1) and (not (pwfSkipDebuggerSettings in WriteFlags)) then
DebugBoss.SaveProjectSpecificInfo(XMLConfig,WriteFlags);
DebugBossMgr.SaveProjectSpecificInfo(XMLConfig,WriteFlags);
if (TheProject=Project1) then
EditorMacroListViewer.SaveProjectSpecificInfo(XMLConfig, WriteFlags);

View File

@ -34,12 +34,7 @@ unit BaseDebugManager;
interface
{$I ide.inc}
uses
{$IFDEF IDE_MEM_CHECK}
MemCheck,
{$ENDIF}
Classes, SysUtils,
// LCL
Forms,
@ -52,8 +47,7 @@ uses
LazDebuggerIntf,
IdeDebuggerOpts,
// IDE
Debugger, IdeDebuggerBase, SourceMarks, Project, ProjectDefs,
LazarusIDEStrConsts;
Debugger, IdeDebuggerBase;
type
TDebugDialogType = (
@ -145,14 +139,6 @@ type
procedure UpdateToolStatus; virtual; abstract;
procedure EnvironmentOptsChanged; virtual; abstract;
procedure LoadProjectSpecificInfo(XMLConfig: TXMLConfig;
Merge: boolean); virtual; abstract;
procedure SaveProjectSpecificInfo(XMLConfig: TXMLConfig;
Flags: TProjectWriteFlags); virtual; abstract;
procedure DoRestoreDebuggerMarks(AnUnitInfo: TUnitInfo); virtual; abstract;
function RequiredCompilerOpts(ATargetCPU, ATargetOS: String): TDebugCompilerRequirements; virtual; abstract;
function InitDebugger(AFlags: TDbgInitFlags = []): Boolean; virtual; abstract;
@ -204,8 +190,7 @@ type
AnUpdating: Boolean = False): TModalResult; virtual; abstract;
function DoDeleteBreakPoint(const AFilename: string; ALine: integer
): TModalResult; virtual; abstract;
function DoDeleteBreakPointAtMark(const ASourceMark: TSourceMark
): TModalResult; virtual; abstract;
function DoDeleteBreakPointAtMark(const ASourceMarkObj: TObject): TModalResult; virtual; abstract;
function ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult; virtual; abstract;
function ShowWatchProperties(const AWatch: TCurrentWatch; AWatchExpression: String = ''): TModalresult; virtual; abstract;

View File

@ -98,6 +98,10 @@
<UnitName Value="WatchInspectToolbar"/>
<ResourceBaseClass Value="Frame"/>
</Item>
<Item>
<Filename Value="basedebugmanager.pas"/>
<UnitName Value="BaseDebugManager"/>
</Item>
</Files>
<i18n>
<EnableI18N Value="True"/>

View File

@ -11,9 +11,9 @@ uses
IdeDebuggerBase, Debugger, ProcessDebugger, ProcessList, DebuggerTreeView,
IdeDebuggerUtils, IdeDebuggerWatchResult, IdeDebuggerWatchResPrinter,
IdeDebuggerWatchResUtils, ArrayNavigationFrame, IdeDebuggerStringConstants,
IdeDebuggerBackendValueConv, IdeDbgValueConverterSettingsFrame,
IdeDebuggerBackendValueConv, IdeDbgValueConverterSettingsFrame,
IdeDebugger_ValConv_Options, IdeDebuggerOpts, IdeDebuggerWatchResultJSon,
WatchInspectToolbar, LazarusPackageIntf;
WatchInspectToolbar, BaseDebugManager, LazarusPackageIntf;
implementation

View File

@ -51,13 +51,15 @@ uses
IDEDialogs, PropEdits, IDEMsgIntf, LazIDEIntf, MenuIntf, IDEWindowIntf, FormEditingIntf,
ObjectInspector, SrcEditorIntf, EditorSyntaxHighlighterDef, UnitResources, ComponentReg,
// IDE
IDEProcs, DialogProcs, IDEProtocol, LazarusIDEStrConsts, NewDialog, NewProjectDlg,
MainBase, MainBar, MainIntf, Project, ProjectDefs, ProjectInspector, CompilerOptions,
SourceSynEditor, SourceEditor, EditorOptions, EnvironmentOpts, CustomFormEditor,
ControlSelection, FormEditor, EmptyMethodsDlg, BaseDebugManager, TransferMacros,
BuildManager, EditorMacroListViewer, FindRenameIdentifier, BuildModesManager,
ViewUnit_Dlg, InputHistory, CheckLFMDlg, etMessagesWnd, SearchPathProcs,
ConvCodeTool, BasePkgManager, PackageDefs, PackageSystem, Designer, DesignerProcs;
IDEProcs, DialogProcs, IDEProtocol, LazarusIDEStrConsts, NewDialog,
NewProjectDlg, MainBase, MainBar, MainIntf, Project, ProjectDefs,
ProjectInspector, CompilerOptions, SourceSynEditor, SourceEditor,
EditorOptions, EnvironmentOpts, CustomFormEditor, ControlSelection,
FormEditor, EmptyMethodsDlg, BaseDebugManager, TransferMacros, BuildManager,
EditorMacroListViewer, FindRenameIdentifier, BuildModesManager, ViewUnit_Dlg,
InputHistory, CheckLFMDlg, etMessagesWnd, DebugManager, SearchPathProcs,
ConvCodeTool, BasePkgManager, PackageDefs, PackageSystem, Designer,
DesignerProcs;
type
@ -616,7 +618,7 @@ begin
//debugln(['TFileOpener.OpenFileInSourceEditor ',AnUnitInfo.Filename]);
// restore source editor settings
DebugBoss.DoRestoreDebuggerMarks(AnUnitInfo);
DebugBossMgr.DoRestoreDebuggerMarks(AnUnitInfo);
NewSrcEdit.SyntaxHighlighterType := AnEditorInfo.SyntaxHighlighter;
NewSrcEdit.EditorComponent.AfterLoadFromFile;
try