mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 19:58:18 +02:00
FpDebug: Handle signals during function-calls
git-svn-id: trunk@65130 -
This commit is contained in:
parent
c136e832f9
commit
fe6e63ed13
@ -238,6 +238,11 @@ type
|
||||
// situation after calling functions inside the debugee)
|
||||
procedure StoreRegisters; virtual; abstract;
|
||||
procedure RestoreRegisters; virtual; abstract;
|
||||
// It could be that an signal led to an exception, and that this
|
||||
// signal is stored to be send to the debuggee again upon continuation.
|
||||
// Use ClearExceptionSignal to remove/eat this signal.
|
||||
procedure ClearExceptionSignal; virtual;
|
||||
|
||||
destructor Destroy; override;
|
||||
function CompareStepInfo(AnAddr: TDBGPtr = 0; ASubLine: Boolean = False): TFPDCompareStepInfo;
|
||||
function IsAtStartOfLine: boolean;
|
||||
@ -2959,6 +2964,11 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TDbgThread.ClearExceptionSignal;
|
||||
begin
|
||||
// To be implemented in sub-classes
|
||||
end;
|
||||
|
||||
{ TFpWatchPointData }
|
||||
|
||||
function TFpWatchPointData.AddOwnedWatchpoint(AnOwner: Pointer;
|
||||
|
@ -521,14 +521,19 @@ begin
|
||||
// at an actual breakpoint.
|
||||
FCallContext.SetError('The function stopped unexpectedly. (Breakpoint, Exception, etc)')
|
||||
else
|
||||
begin
|
||||
// Clear any (pending) signals that were sent to the application during
|
||||
// the function-call.
|
||||
AnEventThread.ClearExceptionSignal;
|
||||
FCallContext.SetError('The function stopped due to an exception.')
|
||||
end;
|
||||
end
|
||||
else
|
||||
// We are at the return-adres. (Phew...)
|
||||
// Store the necessary data into the context to obtain the function-result
|
||||
// later
|
||||
StoreRoutineResult();
|
||||
|
||||
// We are at the return-adres. (Phew...)
|
||||
//remove the hidden breakpoint.
|
||||
RemoveHiddenBreakpointAtReturnAddress;
|
||||
|
||||
|
@ -272,6 +272,7 @@ type
|
||||
procedure SetRegisterValue(AName: string; AValue: QWord); override;
|
||||
procedure StoreRegisters; override;
|
||||
procedure RestoreRegisters; override;
|
||||
procedure ClearExceptionSignal; override;
|
||||
|
||||
function GetInstructionPointerRegisterValue: TDbgPtr; override;
|
||||
function GetStackBasePointerRegisterValue: TDbgPtr; override;
|
||||
@ -548,7 +549,7 @@ procedure TDbgLinuxThread.ResetPauseStates;
|
||||
begin
|
||||
FIsInInternalPause := False;
|
||||
FIsPaused := False;
|
||||
FExceptionSignal := 0;
|
||||
ClearExceptionSignal;
|
||||
FHasThreadState := False;
|
||||
FDidResetInstructionPointer := False;
|
||||
end;
|
||||
@ -775,6 +776,11 @@ begin
|
||||
FStoredUserRegs := FUserRegs;
|
||||
end;
|
||||
|
||||
procedure TDbgLinuxThread.ClearExceptionSignal;
|
||||
begin
|
||||
FExceptionSignal := 0;
|
||||
end;
|
||||
|
||||
{ TDbgLinuxProcess }
|
||||
|
||||
function TDbgLinuxProcess.GetRequiresExecutionInDebuggerThread: boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user