mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 12:20:22 +02:00
FpDebug: Windows, fix stepping over (temp-removed) breakpoint.
- If another thread received a signal before the "step-finished signal" (e.g. thread created / pending sigs) then the temp-break was back in place and kept in place -> the break was hit again instead of stepping over it. - If another thread exited (and the exit signal was received before the "step-finished signal" then no handling was done at all (no threads suspended / no temp remove breaks) git-svn-id: trunk@61877 -
This commit is contained in:
parent
fc1a436bed
commit
cc1055fbed
@ -600,9 +600,21 @@ end;
|
|||||||
|
|
||||||
function TDbgWinProcess.Continue(AProcess: TDbgProcess; AThread: TDbgThread;
|
function TDbgWinProcess.Continue(AProcess: TDbgProcess; AThread: TDbgThread;
|
||||||
SingleStep: boolean): boolean;
|
SingleStep: boolean): boolean;
|
||||||
|
|
||||||
|
function HasThreadInSkippingBreak: Boolean;
|
||||||
|
var
|
||||||
|
t: TDbgThread;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
for t in FThreadMap do
|
||||||
|
if TDbgWinThread(t).FIsSkippingBreakPoint then begin
|
||||||
|
Result := True;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
EventThread, t: TDbgThread;
|
EventThread, t: TDbgThread;
|
||||||
b: Boolean;
|
|
||||||
begin
|
begin
|
||||||
debugln(['TDbgWinProcess.Continue ',SingleStep]);
|
debugln(['TDbgWinProcess.Continue ',SingleStep]);
|
||||||
if assigned(AThread) and not FThreadMap.HasId(AThread.ID) then begin
|
if assigned(AThread) and not FThreadMap.HasId(AThread.ID) then begin
|
||||||
@ -632,24 +644,35 @@ debugln(['## skip brkpoint ',AThread= EventThread, ' iss ',EventThread.NextIsSi
|
|||||||
if (EventThread = AThread) and (SingleStep) then
|
if (EventThread = AThread) and (SingleStep) then
|
||||||
TDbgWinThread(EventThread).SetSingleStep;
|
TDbgWinThread(EventThread).SetSingleStep;
|
||||||
|
|
||||||
b := False;
|
if HasThreadInSkippingBreak then begin
|
||||||
for t in FThreadMap do
|
|
||||||
if TDbgWinThread(t).FIsSkippingBreakPoint then begin
|
|
||||||
b := True;
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if b then begin
|
|
||||||
debugln(['## skip brkpoint (others only) ',AThread= EventThread, ' iss ',EventThread.NextIsSingleStep]);
|
debugln(['## skip brkpoint (others only) ',AThread= EventThread, ' iss ',EventThread.NextIsSingleStep]);
|
||||||
// But other threads are still skipping
|
// But other threads are still skipping
|
||||||
for t in FThreadMap do
|
for t in FThreadMap do
|
||||||
if not (SingleStep and (t = AThread)) then // allow athread to single-step
|
if not (SingleStep and (t = AThread) and // allow athread to single-step
|
||||||
|
not TDbgWinThread(t).FIsSkippingBreakPoint // already single stepping AND needs TempRemoveBreakInstructionCode
|
||||||
|
)
|
||||||
|
then
|
||||||
TDbgWinThread(t).SuspendForStepOverBreakPoint;
|
TDbgWinThread(t).SuspendForStepOverBreakPoint;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (AThread = EventThread) or (TDbgWinThread(AThread).FIsSuspended) then
|
if (AThread = EventThread) or (assigned(AThread) and TDbgWinThread(AThread).FIsSuspended) then
|
||||||
AThread := nil; // Already handled, or suspended
|
AThread := nil; // Already handled, or suspended
|
||||||
|
end
|
||||||
|
|
||||||
|
else begin // EventThread is gone
|
||||||
|
if HasThreadInSkippingBreak then begin
|
||||||
|
debugln(['## skip brkpoint (others only) ']);
|
||||||
|
for t in FThreadMap do
|
||||||
|
if not (SingleStep and (t = AThread) and // allow athread to single-step
|
||||||
|
not TDbgWinThread(t).FIsSkippingBreakPoint // already single stepping AND needs TempRemoveBreakInstructionCode
|
||||||
|
)
|
||||||
|
then
|
||||||
|
TDbgWinThread(t).SuspendForStepOverBreakPoint;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if assigned(AThread) and (TDbgWinThread(AThread).FIsSuspended) then
|
||||||
|
AThread := nil; // no need for singlestep yet
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if assigned(AThread) then
|
if assigned(AThread) then
|
||||||
|
Loading…
Reference in New Issue
Block a user