DBG: Fix watches, do not double request data

git-svn-id: trunk@30746 -
This commit is contained in:
martin 2011-05-15 12:23:47 +00:00
parent 937fe55e63
commit d16f3a06da
2 changed files with 15 additions and 5 deletions

View File

@ -996,11 +996,13 @@ type
TWatchesSupplier = class(TDebuggerDataSupplier)
private
FNotifiedState: TDBGState;
function GetCurrentWatches: TCurrentWatches;
function GetMonitor: TWatchesMonitor;
procedure SetMonitor(const AValue: TWatchesMonitor);
protected
procedure RequestData(AWatchValue: TCurrentWatchValue); virtual;
procedure RequestData(AWatchValue: TCurrentWatchValue);
procedure InternalRequestData(AWatchValue: TCurrentWatchValue); virtual;
procedure DoStateChange(const AOldState: TDBGState); virtual;
public
property Monitor: TWatchesMonitor read GetMonitor write SetMonitor;
@ -2618,7 +2620,6 @@ begin
Result := CreateEntry(AThreadId, AStackFrame, ADisplayFormat);
if Result = nil then exit;
FList.Add(Result);
Result.RequestData;
end;
function TWatchValueList.CreateEntry(const AThreadId: Integer; const AStackFrame: Integer;
@ -2783,13 +2784,22 @@ begin
end;
procedure TWatchesSupplier.RequestData(AWatchValue: TCurrentWatchValue);
begin
if FNotifiedState = dsPause
then InternalRequestData(AWatchValue)
else AWatchValue.SetValidity(ddsInvalid);
end;
procedure TWatchesSupplier.InternalRequestData(AWatchValue: TCurrentWatchValue);
begin
AWatchValue.SetValidity(ddsInvalid);
end;
procedure TWatchesSupplier.DoStateChange(const AOldState: TDBGState);
begin
if (Debugger.State in [dsPause, dsStop, dsInit]) and (CurrentWatches <> nil)
if (Debugger = nil) or (CurrentWatches = nil) then Exit;
FNotifiedState := Debugger.State;
if (Debugger.State in [dsPause, dsStop, dsInit])
then begin
CurrentWatches.ClearValues;
Monitor.NotifyUpdate(CurrentWatches, nil);

View File

@ -924,7 +924,7 @@ type
procedure DoStateChange(const AOldState: TDBGState); override;
procedure Changed;
procedure Clear;
procedure RequestData(AWatchValue: TCurrentWatchValue); override;
procedure InternalRequestData(AWatchValue: TCurrentWatchValue); override;
public
constructor Create(const ADebugger: TDebugger);
destructor Destroy; override;
@ -7627,7 +7627,7 @@ begin
FCommandList.Clear;
end;
procedure TGDBMIWatches.RequestData(AWatchValue: TCurrentWatchValue);
procedure TGDBMIWatches.InternalRequestData(AWatchValue: TCurrentWatchValue);
var
ForceQueue: Boolean;
EvaluationCmdObj: TGDBMIDebuggerCommandEvaluate;