mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 05:40:38 +01:00
LazDebuggerFp: Implement OnIdle, make debug history being recorded.
git-svn-id: trunk@59818 -
This commit is contained in:
parent
4d203a087c
commit
4315025999
@ -83,6 +83,7 @@ type
|
||||
|
||||
TFpDebugDebugger = class(TDebuggerIntf)
|
||||
private
|
||||
FIsIdle: Boolean;
|
||||
FWatchEvalList: TFPList; // Schedule
|
||||
FWatchAsyncQueued: Boolean;
|
||||
FPrettyPrinter: TFpPascalPrettyPrinter;
|
||||
@ -148,6 +149,7 @@ type
|
||||
procedure QuickPause;
|
||||
procedure DoRelease; override;
|
||||
procedure DoState(const OldState: TDBGState); override;
|
||||
function GetIsIdle: Boolean; override;
|
||||
{$ifdef linux}
|
||||
protected
|
||||
FCallStackEntryListThread: TDbgThread;
|
||||
@ -590,7 +592,7 @@ procedure TFPCallStackSupplier.RequestCount(ACallstack: TCallStackBase);
|
||||
var
|
||||
ThreadCallStack: TDbgCallstackEntryList;
|
||||
begin
|
||||
if (Debugger = nil) or not(Debugger.State = dsPause)
|
||||
if (Debugger = nil) or not(Debugger.State in [dsPause, dsInternalPause])
|
||||
then begin
|
||||
ACallstack.SetCountValidity(ddsInvalid);
|
||||
exit;
|
||||
@ -702,7 +704,7 @@ var
|
||||
tid, idx: Integer;
|
||||
cs: TCallStackBase;
|
||||
begin
|
||||
if (Debugger = nil) or not(Debugger.State = dsPause) then begin
|
||||
if (Debugger = nil) or not(Debugger.State = dsPause) then begin // dsInternalPause ?
|
||||
exit;
|
||||
end;
|
||||
|
||||
@ -1071,7 +1073,7 @@ var
|
||||
i: Integer;
|
||||
ARegisterValue: TRegisterValue;
|
||||
begin
|
||||
if (Debugger = nil) or not(Debugger.State in [dsPause, dsStop]) then
|
||||
if (Debugger = nil) or not(Debugger.State in [dsPause, dsInternalPause, dsStop]) then
|
||||
exit;
|
||||
|
||||
ARegisterList := TFpDebugDebugger(Debugger).FDbgController.CurrentThread.RegisterValueList;
|
||||
@ -2022,12 +2024,31 @@ begin
|
||||
if Assigned(FWatchEvalList) then
|
||||
FWatchEvalList.Clear;
|
||||
FWatchAsyncQueued := False;
|
||||
end
|
||||
else
|
||||
if (State in [dsPause, dsInternalPause]) and
|
||||
not(OldState in [dsPause, dsInternalPause]) and
|
||||
Assigned(OnIdle)
|
||||
then begin
|
||||
FIsIdle := True;
|
||||
try
|
||||
OnIdle(Self);
|
||||
except
|
||||
on E: Exception do
|
||||
DebugLn(['exception during idle ', E.ClassName, ': ', E.Message]);
|
||||
end;
|
||||
FIsIdle := False;
|
||||
end;
|
||||
finally
|
||||
UnlockRelease;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFpDebugDebugger.GetIsIdle: Boolean;
|
||||
begin
|
||||
Result := FIsIdle;
|
||||
end;
|
||||
|
||||
{$ifdef linux}
|
||||
procedure TFpDebugDebugger.DoAddBreakLine;
|
||||
begin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user