mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 05:39:17 +02:00
IDE, Debugger: Fix History. Make sure callstack entries are requested.
Currently TDebugManager.DebuggerChangeState triggers 2 consecutive calls do DoDebuggerIdle, so Count may not be available and smrCallStack got set incorrectly.
This commit is contained in:
parent
f6b7ba2662
commit
edb26c9d33
@ -1522,7 +1522,7 @@ type
|
|||||||
|
|
||||||
{ TSnapshotManager }
|
{ TSnapshotManager }
|
||||||
TSnapshotManagerRequestedFlags = set of
|
TSnapshotManagerRequestedFlags = set of
|
||||||
(smrThreads, smrCallStackCnt, smrCallStack, smrLocals, smrWatches);
|
(smrThreads, smrCallStack, smrLocals, smrWatches);
|
||||||
|
|
||||||
TSnapshotManager = class
|
TSnapshotManager = class
|
||||||
private
|
private
|
||||||
@ -2839,13 +2839,14 @@ begin
|
|||||||
if not(smrCallStack in FRequestsDone) then begin
|
if not(smrCallStack in FRequestsDone) then begin
|
||||||
i := FThreads.CurrentThreads.CurrentThreadId;
|
i := FThreads.CurrentThreads.CurrentThreadId;
|
||||||
k := FCallStack.CurrentCallStackList.EntriesForThreads[i].CountLimited(5);
|
k := FCallStack.CurrentCallStackList.EntriesForThreads[i].CountLimited(5);
|
||||||
|
if (not(FCurrentState in [dsPause, dsInternalPause])) or
|
||||||
|
(Debugger = nil) or ( (not Debugger.IsIdle) and (not AForce) )
|
||||||
|
then exit;
|
||||||
if CurSnap <> FCurrentSnapshot then exit; // Debugger did "run" in between
|
if CurSnap <> FCurrentSnapshot then exit; // Debugger did "run" in between
|
||||||
if (k > 0) or (smrCallStackCnt in FRequestsDone) then begin
|
|
||||||
// Since DoDebuggerIdle was re-entered
|
if (k > 0) then begin
|
||||||
// and smrCallStackCnt is set, the count should be valid
|
|
||||||
include(FRequestsDone, smrCallStack);
|
include(FRequestsDone, smrCallStack);
|
||||||
if k > 0
|
FCallStack.CurrentCallStackList.EntriesForThreads[i].PrepareRange(0, Min(5, k));
|
||||||
then FCallStack.CurrentCallStackList.EntriesForThreads[i].PrepareRange(0, Min(5, k));
|
|
||||||
if (not(FCurrentState in [dsPause, dsInternalPause])) or
|
if (not(FCurrentState in [dsPause, dsInternalPause])) or
|
||||||
(Debugger = nil) or ( (not Debugger.IsIdle) and (not AForce) )
|
(Debugger = nil) or ( (not Debugger.IsIdle) and (not AForce) )
|
||||||
then exit;
|
then exit;
|
||||||
@ -2856,16 +2857,6 @@ begin
|
|||||||
FForcedIdle := True;
|
FForcedIdle := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not(smrCallStackCnt in FRequestsDone) then begin
|
|
||||||
include(FRequestsDone, smrCallStackCnt);
|
|
||||||
i := FThreads.CurrentThreads.CurrentThreadId;
|
|
||||||
FCallStack.CurrentCallStackList.EntriesForThreads[i].CountLimited(5);
|
|
||||||
if (not(FCurrentState in [dsPause, dsInternalPause])) or
|
|
||||||
(Debugger = nil) or ( (not Debugger.IsIdle) and (not AForce) )
|
|
||||||
then exit;
|
|
||||||
if CurSnap <> FCurrentSnapshot then exit; // Debugger did "run" in between
|
|
||||||
end;
|
|
||||||
|
|
||||||
if not(smrLocals in FRequestsDone) then begin
|
if not(smrLocals in FRequestsDone) then begin
|
||||||
include(FRequestsDone, smrLocals);
|
include(FRequestsDone, smrLocals);
|
||||||
i := FThreads.CurrentThreads.CurrentThreadId;
|
i := FThreads.CurrentThreads.CurrentThreadId;
|
||||||
|
Loading…
Reference in New Issue
Block a user