Debugger: refactor

git-svn-id: trunk@44463 -
This commit is contained in:
martin 2014-03-18 02:45:28 +00:00
parent 3365e9987e
commit c0924d71a4
8 changed files with 329 additions and 292 deletions

View File

@ -670,6 +670,9 @@ type
property CurrentWatches: TWatchesBase read FCurrentWatches write FCurrentWatches;
end;
TWatchesMonitor = class(TDebuggerDataMonitor)
end;
{%endregion ^^^^^ Watches ^^^^^ }
{%region Locals ***************************************************************
@ -739,6 +742,9 @@ type
property CurrentLocalsList: TLocalsList read FCurrentLocalsList write FCurrentLocalsList;
end;
TLocalsMonitor = class(TDebuggerDataMonitor)
end;
{%endregion ^^^^^ Locals ^^^^^ }
{%region Line Info ************************************************************
@ -897,6 +903,9 @@ type
property CurrentRegistersList: TRegistersList read FCurrentRegistersList write FCurrentRegistersList;
end;
TRegistersMonitor = class(TDebuggerDataMonitor)
end;
{%endregion ^^^^^ Register ^^^^^ }
{%region Callstack ************************************************************
@ -1028,6 +1037,9 @@ type
property CurrentCallStackList: TCallStackListBase read FCurrentCallStackList write FCurrentCallStackList;
end;
TCallStackMonitor = class(TDebuggerDataMonitor)
end;
{%endregion ^^^^^ Callstack ^^^^^ }
{%region ***** Disassembler ***** }
@ -1244,6 +1256,9 @@ type
property CurrentThreads: TThreadsBase read FCurrentThreads write FCurrentThreads;
end;
TThreadsMonitor = class(TDebuggerDataMonitor)
end;
{%endregion ^^^^^ Threads ^^^^^ }
{%region Signals / Exceptions *************************************************}

File diff suppressed because it is too large Load Diff

View File

@ -61,15 +61,15 @@ type
private (* provide some common properties *)
FSnapshotManager: TSnapshotManager;
FSnapshotNotification: TSnapshotNotification;
FThreadsMonitor: TThreadsMonitor;
FThreadsMonitor: TIdeThreadsMonitor;
FThreadsNotification: TThreadsNotification;
FCallStackMonitor: TCallStackMonitor;
FCallStackMonitor: TIdeCallStackMonitor;
FCallStackNotification: TCallStackNotification;
FLocalsMonitor: TLocalsMonitor;
FLocalsMonitor: TIdeLocalsMonitor;
FLocalsNotification: TLocalsNotification;
FWatchesMonitor: TWatchesMonitor;
FWatchesMonitor: TIdeWatchesMonitor;
FWatchesNotification: TWatchesNotification;
FRegistersMonitor: TRegistersMonitor;
FRegistersMonitor: TIdeRegistersMonitor;
FRegistersNotification: TRegistersNotification;
FBreakPoints: TIDEBreakPoints;
FBreakpointsNotification: TIDEBreakPointsNotification;
@ -81,11 +81,11 @@ type
function GetRegistersNotification: TRegistersNotification;
function GetBreakpointsNotification: TIDEBreakPointsNotification;
procedure SetSnapshotManager(const AValue: TSnapshotManager);
procedure SetThreadsMonitor(const AValue: TThreadsMonitor);
procedure SetCallStackMonitor(const AValue: TCallStackMonitor);
procedure SetLocalsMonitor(const AValue: TLocalsMonitor);
procedure SetWatchesMonitor(const AValue: TWatchesMonitor);
procedure SetRegistersMonitor(AValue: TRegistersMonitor);
procedure SetThreadsMonitor(const AValue: TIdeThreadsMonitor);
procedure SetCallStackMonitor(const AValue: TIdeCallStackMonitor);
procedure SetLocalsMonitor(const AValue: TIdeLocalsMonitor);
procedure SetWatchesMonitor(const AValue: TIdeWatchesMonitor);
procedure SetRegistersMonitor(AValue: TIdeRegistersMonitor);
procedure SetBreakPoints(const AValue: TIDEBreakPoints);
protected
procedure JumpToUnitSource(AnUnitInfo: TDebuggerUnitInfo; ALine: Integer);
@ -103,11 +103,11 @@ type
protected
// publish as needed
property SnapshotManager: TSnapshotManager read FSnapshotManager write SetSnapshotManager;
property ThreadsMonitor: TThreadsMonitor read FThreadsMonitor write SetThreadsMonitor;
property CallStackMonitor: TCallStackMonitor read FCallStackMonitor write SetCallStackMonitor;
property LocalsMonitor: TLocalsMonitor read FLocalsMonitor write SetLocalsMonitor;
property WatchesMonitor: TWatchesMonitor read FWatchesMonitor write SetWatchesMonitor;
property RegistersMonitor: TRegistersMonitor read FRegistersMonitor write SetRegistersMonitor;
property ThreadsMonitor: TIdeThreadsMonitor read FThreadsMonitor write SetThreadsMonitor;
property CallStackMonitor: TIdeCallStackMonitor read FCallStackMonitor write SetCallStackMonitor;
property LocalsMonitor: TIdeLocalsMonitor read FLocalsMonitor write SetLocalsMonitor;
property WatchesMonitor: TIdeWatchesMonitor read FWatchesMonitor write SetWatchesMonitor;
property RegistersMonitor: TIdeRegistersMonitor read FRegistersMonitor write SetRegistersMonitor;
property BreakPoints: TIDEBreakPoints read FBreakPoints write SetBreakPoints;
public
destructor Destroy; override;
@ -235,7 +235,7 @@ begin
Result := FBreakpointsNotification;
end;
procedure TDebuggerDlg.SetRegistersMonitor(AValue: TRegistersMonitor);
procedure TDebuggerDlg.SetRegistersMonitor(AValue: TIdeRegistersMonitor);
begin
if FRegistersMonitor = AValue then exit;
BeginUpdate;
@ -268,7 +268,7 @@ begin
end;
end;
procedure TDebuggerDlg.SetThreadsMonitor(const AValue: TThreadsMonitor);
procedure TDebuggerDlg.SetThreadsMonitor(const AValue: TIdeThreadsMonitor);
begin
if FThreadsMonitor = AValue then exit;
BeginUpdate;
@ -285,7 +285,7 @@ begin
end;
end;
procedure TDebuggerDlg.SetCallStackMonitor(const AValue: TCallStackMonitor);
procedure TDebuggerDlg.SetCallStackMonitor(const AValue: TIdeCallStackMonitor);
begin
if FCallStackMonitor = AValue then exit;
BeginUpdate;
@ -302,7 +302,7 @@ begin
end;
end;
procedure TDebuggerDlg.SetLocalsMonitor(const AValue: TLocalsMonitor);
procedure TDebuggerDlg.SetLocalsMonitor(const AValue: TIdeLocalsMonitor);
begin
if FLocalsMonitor = AValue then exit;
BeginUpdate;
@ -318,7 +318,7 @@ begin
end;
end;
procedure TDebuggerDlg.SetWatchesMonitor(const AValue: TWatchesMonitor);
procedure TDebuggerDlg.SetWatchesMonitor(const AValue: TIdeWatchesMonitor);
begin
if FWatchesMonitor = AValue then exit;
BeginUpdate;

View File

@ -3,10 +3,9 @@ program TestGdbmi;
{$mode objfpc}{$H+}
uses
Interfaces, Forms, GuiTestRunner, CompileHelpers,
TestGdbType, TestInstructionQueue, TestDisAss,
TestGDBMIControl,
TestBase, TestException, Testwatches, TestBreakPoint, TestEnvironment, TestArgV;
Interfaces, Forms, GuiTestRunner, CompileHelpers, TestGdbType, TestInstructionQueue,
TestDisAss, TestGDBMIControl, TestBase, TestException, Testwatches, TestBreakPoint,
TestEnvironment, TestArgV, FpGdbmiDebugger;
{$R *.res}

View File

@ -200,17 +200,17 @@ type
TGDBTestCase = class(TTestCase)
private
// stuff for the debugger
FCallStack: TCallStackMonitor;
FCallStack: TIdeCallStackMonitor;
FDisassembler: TIDEDisassembler;
FExceptions: TBaseExceptions;
//FSignals: TBaseSignals;
//FBreakPoints: TIDEBreakPoints;
//FBreakPointGroups: TIDEBreakPointGroups;
FLocals: TLocalsMonitor;
FLocals: TIdeLocalsMonitor;
FLineInfo: TIDELineInfo;
FWatches: TWatchesMonitor;
FThreads: TThreadsMonitor;
FRegisters: TRegistersMonitor;
FWatches: TIdeWatchesMonitor;
FThreads: TIdeThreadsMonitor;
FRegisters: TIdeRegistersMonitor;
private
FParent: TGDBTestsuite;
FTestBaseName: String;
@ -279,14 +279,14 @@ type
//property BreakPoints: TIDEBreakPoints read FBreakpoints; // A list of breakpoints for the current project
//property BreakPointGroups: TIDEBreakPointGroups read FBreakPointGroups;
property Exceptions: TBaseExceptions read FExceptions; // A list of exceptions we should ignore
property CallStack: TCallStackMonitor read FCallStack;
property CallStack: TIdeCallStackMonitor read FCallStack;
property Disassembler: TIDEDisassembler read FDisassembler;
property Locals: TLocalsMonitor read FLocals;
property Locals: TIdeLocalsMonitor read FLocals;
property LineInfo: TIDELineInfo read FLineInfo;
property Registers: TRegistersMonitor read FRegisters;
property Registers: TIdeRegistersMonitor read FRegisters;
//property Signals: TBaseSignals read FSignals; // A list of actions for signals we know of
property Watches: TWatchesMonitor read FWatches;
property Threads: TThreadsMonitor read FThreads;
property Watches: TIdeWatchesMonitor read FWatches;
property Threads: TIdeThreadsMonitor read FThreads;
end;
@ -526,15 +526,15 @@ function TGDBTestCase.StartGDB(AppDir, TestExeName: String): TGDBMIDebugger;
begin
//FBreakPoints := TManagedBreakPoints.Create(Self);
//FBreakPointGroups := TIDEBreakPointGroups.Create;
FWatches := TWatchesMonitor.Create;
FThreads := TThreadsMonitor.Create;
FWatches := TIdeWatchesMonitor.Create;
FThreads := TIdeThreadsMonitor.Create;
FExceptions := TBaseExceptions.Create(TBaseException);
//FSignals := TBaseSignals.Create(TBaseSignal);
FLocals := TLocalsMonitor.Create;
FLocals := TIdeLocalsMonitor.Create;
FLineInfo := TIDELineInfo.Create;
FCallStack := TCallStackMonitor.Create;
FCallStack := TIdeCallStackMonitor.Create;
FDisassembler := TIDEDisassembler.Create;
FRegisters := TRegistersMonitor.Create;
FRegisters := TIdeRegistersMonitor.Create;
Result := GdbClass.Create(DebuggerInfo.ExeName);
Result.OnDbgOutput := @InternalDbgOutPut;

View File

@ -42,16 +42,16 @@ type
TTestDisAss = class(TTestCase)
protected
FCallStack: TCallStackMonitor;
FCallStack: TIdeCallStackMonitor;
FExceptions: TBaseExceptions;
//FSignals: TBaseSignals;
//FBreakPoints: TIDEBreakPoints;
//FBreakPointGroups: TIDEBreakPointGroups;
FLocals: TLocalsMonitor;
FLocals: TIdeLocalsMonitor;
FLineInfo: TIDELineInfo;
FWatches: TWatchesMonitor;
FThreads: TThreadsMonitor;
FRegisters: TRegistersMonitor;
FWatches: TIdeWatchesMonitor;
FThreads: TIdeThreadsMonitor;
FRegisters: TIdeRegistersMonitor;
published
procedure RangeMap;
procedure Disassemble;
@ -335,14 +335,14 @@ var
IdeDisAss := TIDEDisassembler.Create;
IdeDisAss.Master := Gdb.Disassembler;
FWatches := TWatchesMonitor.Create;
FThreads := TThreadsMonitor.Create;
FWatches := TIdeWatchesMonitor.Create;
FThreads := TIdeThreadsMonitor.Create;
FExceptions := TBaseExceptions.Create(TBaseException);
//FSignals := TBaseSignals.Create(TBaseSignal);
FLocals := TLocalsMonitor.Create;
FLocals := TIdeLocalsMonitor.Create;
FLineInfo := TIDELineInfo.Create;
FCallStack := TCallStackMonitor.Create;
FRegisters := TRegistersMonitor.Create;
FCallStack := TIdeCallStackMonitor.Create;
FRegisters := TIdeRegistersMonitor.Create;
//TManagedBreakpoints(FBreakpoints).Master := FDebugger.BreakPoints;
FWatches.Supplier := Gdb.Watches;

View File

@ -107,17 +107,17 @@ type
TBaseDebugManager = class(TBaseDebugManagerIntf)
protected
FDestroying: boolean;
FCallStack: TCallStackMonitor;
FCallStack: TIdeCallStackMonitor;
FDisassembler: TIDEDisassembler;
FExceptions: TIDEExceptions;
FSignals: TIDESignals;
FBreakPoints: TIDEBreakPoints;
FBreakPointGroups: TIDEBreakPointGroups;
FLocals: TLocalsMonitor;
FLocals: TIdeLocalsMonitor;
FLineInfo: TIDELineInfo;
FWatches: TWatchesMonitor;
FThreads: TThreadsMonitor;
FRegisters: TRegistersMonitor;
FWatches: TIdeWatchesMonitor;
FThreads: TIdeThreadsMonitor;
FRegisters: TIdeRegistersMonitor;
FSnapshots: TSnapshotManager;
FManagerStates: TDebugManagerStates;
function GetState: TDBGState; virtual; abstract;
@ -216,14 +216,14 @@ type
property BreakPoints: TIDEBreakPoints read FBreakpoints; // A list of breakpoints for the current project
property BreakPointGroups: TIDEBreakPointGroups read FBreakPointGroups;
property Exceptions: TIDEExceptions read FExceptions; // A list of exceptions we should ignore
property CallStack: TCallStackMonitor read FCallStack;
property CallStack: TIdeCallStackMonitor read FCallStack;
property Disassembler: TIDEDisassembler read FDisassembler;
property Locals: TLocalsMonitor read FLocals;
property Locals: TIdeLocalsMonitor read FLocals;
property LineInfo: TIDELineInfo read FLineInfo;
property Registers: TRegistersMonitor read FRegisters;
property Registers: TIdeRegistersMonitor read FRegisters;
property Signals: TIDESignals read FSignals; // A list of actions for signals we know of
property Watches: TWatchesMonitor read FWatches;
property Threads: TThreadsMonitor read FThreads;
property Watches: TIdeWatchesMonitor read FWatches;
property Threads: TIdeThreadsMonitor read FThreads;
property Snapshots: TSnapshotManager read FSnapshots;
(* TODO: workaround for http://bugs.freepascal.org/view.php?id=21834 *)
property DebuggerClass: TDebuggerClass read GetCurrentDebuggerClass;

View File

@ -1657,15 +1657,15 @@ begin
FUnitInfoProvider := TDebuggerUnitInfoProvider.Create;
FBreakPoints := TManagedBreakPoints.Create(Self);
FBreakPointGroups := TIDEBreakPointGroups.Create;
FWatches := TWatchesMonitor.Create;
FThreads := TThreadsMonitor.Create;
FWatches := TIdeWatchesMonitor.Create;
FThreads := TIdeThreadsMonitor.Create;
FExceptions := TProjectExceptions.Create;
FSignals := TIDESignals.Create;
FLocals := TLocalsMonitor.Create;
FLocals := TIdeLocalsMonitor.Create;
FLineInfo := TIDELineInfo.Create;
FCallStack := TCallStackMonitor.Create;
FCallStack := TIdeCallStackMonitor.Create;
FDisassembler := TIDEDisassembler.Create;
FRegisters := TRegistersMonitor.Create;
FRegisters := TIdeRegistersMonitor.Create;
FSnapshots := TSnapshotManager.Create;
FSnapshots.Threads := FThreads;