DBG: cleanup watches code (apply BeginUpdate block / Use actual valid state)

git-svn-id: trunk@28652 -
This commit is contained in:
martin 2010-12-08 21:21:02 +00:00
parent ddaaeb59b8
commit 2fd897d60d
2 changed files with 19 additions and 14 deletions

View File

@ -3434,7 +3434,7 @@ end;
function TBaseWatch.GetValid: TValidState;
begin
Result := vsUnknown;
Result := FValid;
end;
function TBaseWatch.GetValue: String;

View File

@ -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;