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