mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 01:02:41 +02:00
Debugger, GDBMI: fix internal pause for changing breakpoint (or retrieving line info), so the current command can continue.
git-svn-id: trunk@63308 -
This commit is contained in:
parent
e4d3c2df74
commit
c0e6dd10c0
@ -94,7 +94,7 @@ type
|
|||||||
|
|
||||||
|
|
||||||
TGDBMICallback = procedure(const AResult: TGDBMIExecResult; const ATag: PtrInt) of object;
|
TGDBMICallback = procedure(const AResult: TGDBMIExecResult; const ATag: PtrInt) of object;
|
||||||
TGDBMIPauseWaitState = (pwsNone, pwsInternal, pwsExternal);
|
TGDBMIPauseWaitState = (pwsNone, pwsInternal, pwsInternalCont, pwsExternal);
|
||||||
|
|
||||||
TGDBMITargetFlag = (
|
TGDBMITargetFlag = (
|
||||||
tfHasSymbols, // Debug symbols are present
|
tfHasSymbols, // Debug symbols are present
|
||||||
@ -952,7 +952,7 @@ type
|
|||||||
function GDBModify(const AExpression, ANewValue: String): Boolean;
|
function GDBModify(const AExpression, ANewValue: String): Boolean;
|
||||||
procedure GDBModifyDone(const {%H-}AResult: TGDBMIExecResult; const {%H-}ATag: PtrInt);
|
procedure GDBModifyDone(const {%H-}AResult: TGDBMIExecResult; const {%H-}ATag: PtrInt);
|
||||||
function GDBRun: Boolean;
|
function GDBRun: Boolean;
|
||||||
function GDBPause(const AInternal: Boolean): Boolean;
|
function GDBPause(const AInternal: Boolean; const AContinueCmd: Boolean = False): Boolean;
|
||||||
function GDBStop: Boolean;
|
function GDBStop: Boolean;
|
||||||
function GDBStepOver: Boolean;
|
function GDBStepOver: Boolean;
|
||||||
function GDBStepInto: Boolean;
|
function GDBStepInto: Boolean;
|
||||||
@ -3341,7 +3341,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
FDidKillNow := True;
|
FDidKillNow := True;
|
||||||
if StoppedParams <> ''
|
if StoppedParams <> ''
|
||||||
then ProcessStopped(StoppedParams, FTheDebugger.PauseWaitState = pwsInternal);
|
then ProcessStopped(StoppedParams, FTheDebugger.PauseWaitState in [pwsInternal, pwsInternalCont]);
|
||||||
FTheDebugger.FPauseWaitState := pwsNone;
|
FTheDebugger.FPauseWaitState := pwsNone;
|
||||||
|
|
||||||
ExecuteCommand('kill', [cfNoThreadContext], 1500);
|
ExecuteCommand('kill', [cfNoThreadContext], 1500);
|
||||||
@ -6266,8 +6266,10 @@ function TGDBMIDebuggerCommandExecute.ProcessStopped(const AParams: String;
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
if SigInt and (FTheDebugger.PauseWaitState = pwsInternalCont) then
|
||||||
|
Result := True;
|
||||||
|
|
||||||
if not AIgnoreSigIntState // not pwsInternal
|
if not AIgnoreSigIntState // not pwsInternal / pwsInternalCont
|
||||||
or not SigInt
|
or not SigInt
|
||||||
then begin
|
then begin
|
||||||
// user-requested pause OR other signal (not sigint)
|
// user-requested pause OR other signal (not sigint)
|
||||||
@ -7515,7 +7517,7 @@ begin
|
|||||||
|
|
||||||
ContinueStep := False;
|
ContinueStep := False;
|
||||||
if StoppedParams <> ''
|
if StoppedParams <> ''
|
||||||
then ContinueExecution := ProcessStopped(StoppedParams, FTheDebugger.PauseWaitState = pwsInternal);
|
then ContinueExecution := ProcessStopped(StoppedParams, FTheDebugger.PauseWaitState in [pwsInternal, pwsInternalCont]);
|
||||||
|
|
||||||
// FFpcSpecificHandlerCallFin was either hit, or the handler was exited
|
// FFpcSpecificHandlerCallFin was either hit, or the handler was exited
|
||||||
FTheDebugger.FFpcSpecificHandlerCallFin.Clear(Self);
|
FTheDebugger.FFpcSpecificHandlerCallFin.Clear(Self);
|
||||||
@ -7535,6 +7537,10 @@ begin
|
|||||||
FTheDebugger.QueueExecuteLock; // force queue
|
FTheDebugger.QueueExecuteLock; // force queue
|
||||||
FTheDebugger.QueueCommand(NextExecCmdObj, DebuggerState = dsInternalPause); // TODO: ForceQueue, only until better means of queue control... (allow snapshot to run)
|
FTheDebugger.QueueCommand(NextExecCmdObj, DebuggerState = dsInternalPause); // TODO: ForceQueue, only until better means of queue control... (allow snapshot to run)
|
||||||
FTheDebugger.QueueExecuteUnlock;
|
FTheDebugger.QueueExecuteUnlock;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if FTheDebugger.PauseWaitState = pwsInternalCont then begin
|
||||||
|
FTheDebugger.RunQueue;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -7550,7 +7556,7 @@ begin
|
|||||||
FTheDebugger.FMainAddrBreak.Clear(Self);
|
FTheDebugger.FMainAddrBreak.Clear(Self);
|
||||||
|
|
||||||
if (not ContinueExecution) and (DebuggerState = dsRun) and
|
if (not ContinueExecution) and (DebuggerState = dsRun) and
|
||||||
(FTheDebugger.PauseWaitState <> pwsInternal)
|
not (FTheDebugger.PauseWaitState in [pwsInternal, pwsInternalCont])
|
||||||
then begin
|
then begin
|
||||||
// Handle the unforeseen
|
// Handle the unforeseen
|
||||||
if (StoppedParams <> '')
|
if (StoppedParams <> '')
|
||||||
@ -8133,7 +8139,7 @@ begin
|
|||||||
|
|
||||||
// Need to interupt debugger
|
// Need to interupt debugger
|
||||||
if Debugger.State = dsRun
|
if Debugger.State = dsRun
|
||||||
then TGDBMIDebuggerBase(Debugger).GDBPause(True);
|
then TGDBMIDebuggerBase(Debugger).GDBPause(True, True);
|
||||||
|
|
||||||
FGetLineSymbolsCmdObj := TGDBMIDebuggerCommandLineSymbolInfo.Create(TGDBMIDebuggerBase(Debugger), ASource);
|
FGetLineSymbolsCmdObj := TGDBMIDebuggerCommandLineSymbolInfo.Create(TGDBMIDebuggerBase(Debugger), ASource);
|
||||||
FGetLineSymbolsCmdObj.OnExecuted := @DoGetLineSymbolsFinished;
|
FGetLineSymbolsCmdObj.OnExecuted := @DoGetLineSymbolsFinished;
|
||||||
@ -9043,7 +9049,7 @@ begin
|
|||||||
if FCommandQueue.Count = 0
|
if FCommandQueue.Count = 0
|
||||||
then begin
|
then begin
|
||||||
if (FInExecuteCount = 0) // not in Recursive call
|
if (FInExecuteCount = 0) // not in Recursive call
|
||||||
and (FPauseWaitState = pwsInternal)
|
and (FPauseWaitState in [pwsInternal, pwsInternalCont])
|
||||||
and (State = dsRun)
|
and (State = dsRun)
|
||||||
then begin
|
then begin
|
||||||
// reset state
|
// reset state
|
||||||
@ -9364,7 +9370,7 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
|
|
||||||
if State = dsRun
|
if State = dsRun
|
||||||
then GDBPause(True);
|
then GDBPause(True, True);
|
||||||
if ASet then
|
if ASet then
|
||||||
begin
|
begin
|
||||||
S := EscapeGDBCommand(AVariable);
|
S := EscapeGDBCommand(AVariable);
|
||||||
@ -9464,7 +9470,8 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGDBMIDebuggerBase.GDBPause(const AInternal: Boolean): Boolean;
|
function TGDBMIDebuggerBase.GDBPause(const AInternal: Boolean;
|
||||||
|
const AContinueCmd: Boolean): Boolean;
|
||||||
begin
|
begin
|
||||||
if FInProcessStopped then exit;
|
if FInProcessStopped then exit;
|
||||||
|
|
||||||
@ -9474,8 +9481,10 @@ begin
|
|||||||
|
|
||||||
if AInternal
|
if AInternal
|
||||||
then begin
|
then begin
|
||||||
if FPauseWaitState = pwsNone
|
if FPauseWaitState = pwsNone then
|
||||||
then FPauseWaitState := pwsInternal;
|
if AContinueCmd
|
||||||
|
then FPauseWaitState := pwsInternalCont
|
||||||
|
else FPauseWaitState := pwsInternal;
|
||||||
end
|
end
|
||||||
else FPauseWaitState := pwsExternal;
|
else FPauseWaitState := pwsExternal;
|
||||||
|
|
||||||
@ -10634,7 +10643,7 @@ begin
|
|||||||
TGDBMIDebuggerBase(Debugger).QueueCommand(FCurrentCmd);
|
TGDBMIDebuggerBase(Debugger).QueueCommand(FCurrentCmd);
|
||||||
|
|
||||||
if Debugger.State = dsRun
|
if Debugger.State = dsRun
|
||||||
then TGDBMIDebuggerBase(Debugger).GDBPause(True);
|
then TGDBMIDebuggerBase(Debugger).GDBPause(True, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGDBMIBreakPoint.DoCommandDestroyed(Sender: TObject);
|
procedure TGDBMIBreakPoint.DoCommandDestroyed(Sender: TObject);
|
||||||
@ -10741,7 +10750,7 @@ begin
|
|||||||
SetHitCount(0);
|
SetHitCount(0);
|
||||||
|
|
||||||
if Debugger.State = dsRun
|
if Debugger.State = dsRun
|
||||||
then TGDBMIDebuggerBase(Debugger).GDBPause(True);
|
then TGDBMIDebuggerBase(Debugger).GDBPause(True, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGDBMIBreakPoint.SetLocation(const ASource: String; const ALine: Integer);
|
procedure TGDBMIBreakPoint.SetLocation(const ASource: String; const ALine: Integer);
|
||||||
@ -10837,7 +10846,7 @@ begin
|
|||||||
TGDBMIDebuggerBase(Debugger).QueueCommand(FCurrentCmd);
|
TGDBMIDebuggerBase(Debugger).QueueCommand(FCurrentCmd);
|
||||||
|
|
||||||
if Debugger.State = dsRun
|
if Debugger.State = dsRun
|
||||||
then TGDBMIDebuggerBase(Debugger).GDBPause(True);
|
then TGDBMIDebuggerBase(Debugger).GDBPause(True, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{%endregion ^^^^^ BreakPoints ^^^^^ }
|
{%endregion ^^^^^ BreakPoints ^^^^^ }
|
||||||
|
Loading…
Reference in New Issue
Block a user