FpDebug: Linux, fix for temp-removed breakpoints were not always restored (if another thread had pending events, writing the breakpoint in WaitForEvent would fail, due to thread running / signal not yet collected)

git-svn-id: trunk@61829 -
This commit is contained in:
martin 2019-09-08 18:52:35 +00:00
parent 999d567e45
commit 85a8100c39

View File

@ -998,9 +998,18 @@ begin
exit;
end;
// If the thread is at a breakpoint, then it must be singlestepped now, so the breakpoint can be restored
// since the other threads may still have events to be handled they can not be continued yet
// TODO: Handle all events in a single AnalyseDebugEvent / or at least hava a FCurrentBreakpoint per thread
// check for pending events in other threads
assert(not TDbgLinuxThread(AThread).FHasExceptionSignal, 'current thread must not have deferred sig');
for TDbgThread(ThreadToContinue) in FThreadMap do
if (ThreadToContinue.FHasExceptionSignal) then begin
Assert(not ThreadToContinue.FIsInInternalPause, 'internal pause should not have deferred sig');
AThread.NextIsSingleStep:=False; // UNDO
{$IFDEF DebuglnLinuxDebugEvents}
debugln(['Exit for DEFERRED event TID', ThreadToContinue.Id]);
{$ENDIF}
exit; // WaitForDebugEvent will report the event // AThread will now be treaded as paused.
end;
AThread.NextIsSingleStep:=SingleStep;
@ -1054,20 +1063,6 @@ begin
exit;
end;
// check for pending events in other threads
// TODO: those should happen before doing the singlestep at int3. But then breakpoints would act again....
assert(not TDbgLinuxThread(AThread).FHasExceptionSignal, 'current thread must not have deferred sig');
for TDbgThread(ThreadToContinue) in FThreadMap do
if (ThreadToContinue.FHasExceptionSignal) then begin
Assert(not ThreadToContinue.FIsInInternalPause, 'internal pause should not have deferred sig');
AThread.NextIsSingleStep:=False; // UNDO
{$IFDEF DebuglnLinuxDebugEvents}
debugln(['Exit for DEFERRED event TID', ThreadToContinue.Id]);
{$ENDIF}
exit; // WaitForDebugEvent will report the event // AThread will now be treaded as paused.
end;
ThreadsBeforeContinue;
// start all other threads