mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 06:29:29 +02:00
DBG: cleanup watches code (apply BeginUpdate block / Use actual valid state)
git-svn-id: trunk@28652 -
This commit is contained in:
parent
ddaaeb59b8
commit
2fd897d60d
@ -3434,7 +3434,7 @@ end;
|
||||
|
||||
function TBaseWatch.GetValid: TValidState;
|
||||
begin
|
||||
Result := vsUnknown;
|
||||
Result := FValid;
|
||||
end;
|
||||
|
||||
function TBaseWatch.GetValue: String;
|
||||
|
@ -6620,23 +6620,28 @@ begin
|
||||
if FEvaluatedState in [esValid, esRequested] then Exit;
|
||||
if Debugger = nil then Exit;
|
||||
|
||||
if (Debugger.State in [dsPause, dsStop])
|
||||
if (Debugger.State = dsPause)
|
||||
and Enabled
|
||||
then begin
|
||||
FInEvaluationNeeded := True;
|
||||
FEvaluatedState := esRequested;
|
||||
ClearOwned;
|
||||
SetValid(vsValid);
|
||||
FEvaluationCmdObj := TGDBMIDebuggerCommandEvaluate.Create
|
||||
(TGDBMIDebugger(Debugger), Expression, DisplayFormat);
|
||||
FEvaluationCmdObj.OnExecuted := @DoEvaluationFinished;
|
||||
FEvaluationCmdObj.OnDestroy := @DoEvaluationDestroyed;
|
||||
TGDBMIDebugger(Debugger).QueueCommand(FEvaluationCmdObj);
|
||||
(* DoEvaluationFinished may be called immediately at this point *)
|
||||
FInEvaluationNeeded := False;
|
||||
BeginUpdate; // aviod change early trigger bt SetValid
|
||||
try
|
||||
FInEvaluationNeeded := True;
|
||||
FEvaluatedState := esRequested;
|
||||
ClearOwned;
|
||||
SetValid(vsValid);
|
||||
FEvaluationCmdObj := TGDBMIDebuggerCommandEvaluate.Create
|
||||
(TGDBMIDebugger(Debugger), Expression, DisplayFormat);
|
||||
FEvaluationCmdObj.OnExecuted := @DoEvaluationFinished;
|
||||
FEvaluationCmdObj.OnDestroy := @DoEvaluationDestroyed;
|
||||
TGDBMIDebugger(Debugger).QueueCommand(FEvaluationCmdObj);
|
||||
(* DoEvaluationFinished may be called immediately at this point *)
|
||||
FInEvaluationNeeded := False;
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
SetValid(vsInvalid);
|
||||
SetValid(vsUnknown);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user