FpDebug: Handle signals during function-calls

git-svn-id: trunk@65130 -
This commit is contained in:
joost 2021-05-24 22:15:35 +00:00
parent c136e832f9
commit fe6e63ed13
3 changed files with 23 additions and 2 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;