IdeDebugger: Fix nil pointer access in "Fix Display-Format related conversion of numeric watches." 28ac5176a9

This commit is contained in:
Martin 2022-05-17 15:19:50 +02:00
parent 6ae79c8197
commit 43e385a90b

View File

@ -882,6 +882,7 @@ var
i: integer;
d: TIdeWatchValue;
t: TDBGType;
s: String;
begin
if not nbInspect.Visible then exit;
DebugBoss.LockCommandProcessing;
@ -895,6 +896,12 @@ begin
exit;
InspectLabel.Caption := Watch.Expression;
if not(Watch.Enabled and Watch.HasAllValidParents(GetThreadId, GetStackframe)) then begin
InspectMemo.WordWrap := True;
InspectMemo.Text := '<evaluating>';
exit;
end;
d := Watch.Values[GetThreadId, GetStackframe];
if d = nil then begin
InspectMemo.WordWrap := True;
@ -934,7 +941,11 @@ begin
end;
InspectMemo.WordWrap := True;
InspectMemo.Text := DebugBoss.FormatValue(d.TypeInfo, PrintWatchValue(d.ResultData, d.DisplayFormat));
if d.ResultData <> nil then
s := PrintWatchValue(d.ResultData, d.DisplayFormat)
else
s := d.Value;
InspectMemo.Text := DebugBoss.FormatValue(d.TypeInfo, s);
finally
DebugBoss.UnLockCommandProcessing;
end;