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