FpDebug: Fix Command.DoContinue. Do not read DbgThread.GetInstrPtr if the event is caused by another thread. On Linux the none-event thread (belonging to the command) may not be paused/readable.

git-svn-id: trunk@62492 -
This commit is contained in:
martin 2020-01-04 19:02:04 +00:00
parent 6cc8e56bdc
commit 2282f707cf

View File

@ -516,10 +516,12 @@ procedure TDbgControllerHiddenBreakStepBaseCmd.DoContinue(AProcess: TDbgProcess;
AThread: TDbgThread);
begin
InternalContinue(AProcess, AThread);
if (AThread = FThread) then begin
if ((FNextInstruction.OpCode = OPret) or (FNextInstruction.OpCode = OPretf)) and
(FHiddenBreakpoint = nil)
then
FIsSteppedOut := True;
end;
FNextInstruction.OpCode := OPX_InternalUnknown;
FNextInstructionLen := 0;
end;
@ -530,6 +532,7 @@ procedure TDbgControllerStepOverInstructionCmd.InternalContinue(
AProcess: TDbgProcess; AThread: TDbgThread);
begin
assert(FProcess=AProcess, 'TDbgControllerStepOverInstructionCmd.DoContinue: FProcess=AProcess');
if (AThread = FThread) then
CheckForCallAndSetBreak;
FProcess.Continue(FProcess, FThread, FHiddenBreakpoint = nil);
end;
@ -629,7 +632,7 @@ procedure TDbgControllerStepIntoLineCmd.InternalContinue(AProcess: TDbgProcess;
AThread: TDbgThread);
begin
assert(FProcess=AProcess, 'TDbgControllerStepIntoLineCmd.DoContinue: FProcess=AProcess');
if FState = siSteppingCurrent then
if (FState = siSteppingCurrent) and (AThread = FThread) then
begin
if CheckForCallAndSetBreak then begin
FState := siSteppingIn;
@ -704,6 +707,7 @@ procedure TDbgControllerStepOverLineCmd.InternalContinue(AProcess: TDbgProcess;
AThread: TDbgThread);
begin
assert(FProcess=AProcess, 'TDbgControllerStepOverLineCmd.DoContinue: FProcess=AProcess');
if (AThread = FThread) then
CheckForCallAndSetBreak;
FProcess.Continue(FProcess, FThread, FHiddenBreakpoint = nil);
end;
@ -781,6 +785,7 @@ var
begin
assert(FProcess=AProcess, 'TDbgControllerStepOutCmd.DoContinue: FProcess=AProcess');
if (AThread = FThread) then begin
if IsSteppedOut then begin
CheckForCallAndSetBreak;
end
@ -815,6 +820,7 @@ begin
SetReturnAdressBreakpoint(AProcess, False);
end;
end;
end;
FProcess.Continue(FProcess, FThread, FHiddenBreakpoint = nil);
end;