mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 11:19:40 +02:00
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:
parent
999d567e45
commit
85a8100c39
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user