FpDebug: Fix dangling pointer, if debug-backend sets breakpoint too late.

(cherry picked from commit ec98b15709)
This commit is contained in:
Martin 2024-01-19 15:41:24 +01:00
parent af2489f6ff
commit fbb65eaa20

View File

@ -2871,7 +2871,7 @@ end;
procedure TDbgProcess.AfterBreakpointAdded(ABreak: TFpDbgBreakpoint);
begin
if not assigned(FCurrentBreakpoint) then begin
if (FMainThread <> nil) and not assigned(FCurrentBreakpoint) then begin
if ABreak.HasLocation(FMainThread.GetInstructionPointerRegisterValue) then
FCurrentBreakpoint := TFpInternalBreakpoint(ABreak);
end;