Debugger: Fix eval watch hint in selected StackFrame

This commit is contained in:
Martin 2022-07-21 21:34:03 +02:00
parent 9f08e2006b
commit 5357d6a3f0

View File

@ -11443,8 +11443,9 @@ var
BaseURL, SmartHintStr, Expression: String;
HasHint: Boolean;
Opts: TWatcheEvaluateFlags;
AtomStartPos, AtomEndPos, tid: integer;
AtomStartPos, AtomEndPos, tid, st: integer;
aWatch: TCurrentWatch;
CStack: TIdeCallStack;
begin
//DebugLn(['TMainIDE.SrcNotebookShowHintForSource START']);
if (SrcEdit=nil) then exit;
@ -11512,8 +11513,12 @@ begin
aWatch.Enabled := True;
DebugBoss.CurrentWatches.EndUpdate;
tid := DebugBoss.Threads.CurrentThreads.CurrentThreadId;
FHintWatchData.WatchValue := aWatch.Values[tid, 0] as TCurrentWatchValue;
tid := DebugBoss.Threads.CurrentThreads.CurrentThreadId;
st := 0;
CStack := DebugBoss.CallStack.CurrentCallStackList.EntriesForThreads[tid];
if CStack <> nil then
st := CStack.CurrentIndex;
FHintWatchData.WatchValue := aWatch.Values[tid, st] as TCurrentWatchValue;
FHintWatchData.WatchValue.OnValidityChanged := @OnHintWatchValidityChanged;
FHintWatchData.WatchValue.Value;
OnHintWatchValidityChanged(FHintWatchData.WatchValue);