mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 16:39:26 +02:00
DBG: Fix watches, do not double request data
git-svn-id: trunk@30746 -
This commit is contained in:
parent
937fe55e63
commit
d16f3a06da
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user