mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-18 08:05:56 +02:00
Debugger: Remove IDbgWatchValueIntf.Value in favour of IDbgWatchValueIntf.ResData.CreatePrePrinted
This commit is contained in:
parent
fee8dbf80e
commit
adc63a1a42
@ -14713,7 +14713,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FWatchValue.Value := FTextValue;
|
FWatchValue.ResData.CreatePrePrinted(FTextValue);
|
||||||
FWatchValue.TypeInfo := TypeInfo;
|
FWatchValue.TypeInfo := TypeInfo;
|
||||||
FTypeInfo := nil;
|
FTypeInfo := nil;
|
||||||
FWatchValue.Validity := FValidity;
|
FWatchValue.Validity := FValidity;
|
||||||
|
@ -1150,8 +1150,9 @@ begin
|
|||||||
ErrorHandler.OnErrorTextLookup := @GetErrorText;
|
ErrorHandler.OnErrorTextLookup := @GetErrorText;
|
||||||
AResText := ErrorHandler.ErrorAsString(APasExpr.Error);
|
AResText := ErrorHandler.ErrorAsString(APasExpr.Error);
|
||||||
if FWatchValue <> nil then begin
|
if FWatchValue <> nil then begin
|
||||||
FWatchValue.Value := AResText;
|
FWatchValue.BeginUpdate;
|
||||||
FWatchValue.Validity := ddsError;
|
FWatchValue.ResData.CreateError(AResText);
|
||||||
|
FWatchValue.EndUpdate;
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -1160,8 +1161,9 @@ begin
|
|||||||
if ResValue = nil then begin
|
if ResValue = nil then begin
|
||||||
AResText := 'Error';
|
AResText := 'Error';
|
||||||
if FWatchValue <> nil then begin
|
if FWatchValue <> nil then begin
|
||||||
FWatchValue.Value := AResText;
|
FWatchValue.BeginUpdate;
|
||||||
FWatchValue.Validity := ddsError;
|
FWatchValue.ResData.CreateError(AResText);
|
||||||
|
FWatchValue.EndUpdate;
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -1268,9 +1270,11 @@ begin
|
|||||||
if not Result then
|
if not Result then
|
||||||
FreeAndNil(ATypeInfo);
|
FreeAndNil(ATypeInfo);
|
||||||
if FWatchValue <> nil then begin
|
if FWatchValue <> nil then begin
|
||||||
FWatchValue.Value := AResText;
|
FWatchValue.BeginUpdate;
|
||||||
|
FWatchValue.ResData.CreatePrePrinted(AResText);
|
||||||
FWatchValue.TypeInfo := ATypeInfo;
|
FWatchValue.TypeInfo := ATypeInfo;
|
||||||
FWatchValue.Validity := ddsValid;
|
FWatchValue.Validity := ddsValid;
|
||||||
|
FWatchValue.EndUpdate;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
PrettyPrinter.Free;
|
PrettyPrinter.Free;
|
||||||
|
@ -646,21 +646,24 @@ end;
|
|||||||
procedure TFPDSendWatchEvaluateCommand.DoOnCommandSuccesfull(ACommandResponse: TJSonObject);
|
procedure TFPDSendWatchEvaluateCommand.DoOnCommandSuccesfull(ACommandResponse: TJSonObject);
|
||||||
var
|
var
|
||||||
s: string;
|
s: string;
|
||||||
i: TDebuggerDataState;
|
i, V: TDebuggerDataState;
|
||||||
begin
|
begin
|
||||||
inherited DoOnCommandSuccesfull(ACommandResponse);
|
inherited DoOnCommandSuccesfull(ACommandResponse);
|
||||||
|
|
||||||
if assigned(FWatchValue) then
|
if assigned(FWatchValue) then
|
||||||
begin
|
begin
|
||||||
FWatchValue.Value:=ACommandResponse.Get('message','');
|
FWatchValue.BeginUpdate;
|
||||||
|
FWatchValue.ResData.CreatePrePrinted(ACommandResponse.Get('message',''));
|
||||||
s := ACommandResponse.Get('validity','');
|
s := ACommandResponse.Get('validity','');
|
||||||
FWatchValue.Validity:=ddsError;
|
V := ddsError;
|
||||||
for i := low(TDebuggerDataState) to high(TDebuggerDataState) do
|
for i := low(TDebuggerDataState) to high(TDebuggerDataState) do
|
||||||
if DebuggerDataStateStr[i]=s then
|
if DebuggerDataStateStr[i]=s then
|
||||||
begin
|
begin
|
||||||
FWatchValue.Validity:=i;
|
V :=i;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
|
FWatchValue.Validity:=V;
|
||||||
|
FWatchValue.EndUpdate;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1081,13 +1081,11 @@ begin
|
|||||||
if not IsWatchValueAlive then exit;
|
if not IsWatchValueAlive then exit;
|
||||||
|
|
||||||
if not PasExpr.Valid then begin
|
if not PasExpr.Valid then begin
|
||||||
DebugLn(DBG_VERBOSE, [ErrorHandler.ErrorAsString(PasExpr.Error)]);
|
|
||||||
if ErrorCode(PasExpr.Error) <> fpErrAnyError then begin
|
if ErrorCode(PasExpr.Error) <> fpErrAnyError then begin
|
||||||
Result := True;
|
Result := True;
|
||||||
AResText := ErrorHandler.ErrorAsString(PasExpr.Error);;
|
AResText := ErrorHandler.ErrorAsString(PasExpr.Error);
|
||||||
if AWatchValue <> nil then begin;
|
if AWatchValue <> nil then begin;
|
||||||
AWatchValue.Value := AResText;
|
AWatchValue.ResData.CreateError(AResText);
|
||||||
AWatchValue.Validity := ddsError;
|
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -1151,7 +1149,7 @@ DebugLn(DBG_VERBOSE, [ErrorHandler.ErrorAsString(PasExpr.Error)]);
|
|||||||
Result := True;
|
Result := True;
|
||||||
if AWatchValue <> nil then begin
|
if AWatchValue <> nil then begin
|
||||||
if not IsWatchValueAlive then exit;
|
if not IsWatchValueAlive then exit;
|
||||||
AWatchValue.Value := AResText;
|
AWatchValue.ResData.CreatePrePrinted(AResText);
|
||||||
AWatchValue.Validity := ddsValid; // TODO ddsError ?
|
AWatchValue.Validity := ddsValid; // TODO ddsError ?
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
@ -1181,12 +1179,15 @@ DebugLn(DBG_VERBOSE, [ErrorHandler.ErrorAsString(PasExpr.Error)]);
|
|||||||
Result := True;
|
Result := True;
|
||||||
debugln(DBG_VERBOSE, ['TFPGDBMIWatches.InternalRequestData GOOOOOOD ', AExpression]);
|
debugln(DBG_VERBOSE, ['TFPGDBMIWatches.InternalRequestData GOOOOOOD ', AExpression]);
|
||||||
if AWatchValue <> nil then begin
|
if AWatchValue <> nil then begin
|
||||||
AWatchValue.Value := AResText;
|
|
||||||
AWatchValue.TypeInfo := ATypeInfo;
|
AWatchValue.TypeInfo := ATypeInfo;
|
||||||
if IsError(ResValue.LastError) then
|
if IsError(ResValue.LastError) then begin
|
||||||
AWatchValue.Validity := ddsError
|
AWatchValue.ResData.CreateError(AResText);
|
||||||
else
|
AWatchValue.Validity := ddsError;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
AWatchValue.ResData.CreatePrePrinted(AResText);
|
||||||
AWatchValue.Validity := ddsValid;
|
AWatchValue.Validity := ddsValid;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1717,8 +1717,7 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
AResText := ErrorHandler.ErrorAsString(PasExpr.Error);
|
AResText := ErrorHandler.ErrorAsString(PasExpr.Error);
|
||||||
if AWatchValue <> nil then begin
|
if AWatchValue <> nil then begin
|
||||||
AWatchValue.Value := AResText;
|
AWatchValue.ResData.CreateError(AResText);
|
||||||
AWatchValue.Validity := ddsError;
|
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -1796,7 +1795,7 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
if AWatchValue <> nil then begin
|
if AWatchValue <> nil then begin
|
||||||
if not IsWatchValueAlive then exit;
|
if not IsWatchValueAlive then exit;
|
||||||
AWatchValue.Value := AResText;
|
AWatchValue.ResData.CreatePrePrinted(AResText);
|
||||||
AWatchValue.Validity := ddsValid; // TODO ddsError ?
|
AWatchValue.Validity := ddsValid; // TODO ddsError ?
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
@ -1829,12 +1828,15 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
debugln(DBG_VERBOSE, ['TFPLldbWatches.InternalRequestData GOOOOOOD ', AExpression]);
|
debugln(DBG_VERBOSE, ['TFPLldbWatches.InternalRequestData GOOOOOOD ', AExpression]);
|
||||||
if AWatchValue <> nil then begin
|
if AWatchValue <> nil then begin
|
||||||
AWatchValue.Value := AResText;
|
|
||||||
AWatchValue.TypeInfo := ATypeInfo;
|
AWatchValue.TypeInfo := ATypeInfo;
|
||||||
if IsError(ResValue.LastError) then
|
if IsError(ResValue.LastError) then begin
|
||||||
AWatchValue.Validity := ddsError
|
AWatchValue.ResData.CreateError(AResText);
|
||||||
else
|
AWatchValue.Validity := ddsError;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
AWatchValue.ResData.CreatePrePrinted(AResText);
|
||||||
AWatchValue.Validity := ddsValid;
|
AWatchValue.Validity := ddsValid;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -246,9 +246,7 @@ type
|
|||||||
function GetThreadId: Integer;
|
function GetThreadId: Integer;
|
||||||
function GetValidity: TDebuggerDataState;
|
function GetValidity: TDebuggerDataState;
|
||||||
procedure SetTypeInfo(AValue: TDBGTypeBase);
|
procedure SetTypeInfo(AValue: TDBGTypeBase);
|
||||||
function GetValue: String; // FpGdbmiDebugger
|
|
||||||
procedure SetValidity(AValue: TDebuggerDataState);
|
procedure SetValidity(AValue: TDebuggerDataState);
|
||||||
procedure SetValue(AValue: String);
|
|
||||||
|
|
||||||
property EvaluateFlags: TWatcheEvaluateFlags read GetEvaluateFlags;
|
property EvaluateFlags: TWatcheEvaluateFlags read GetEvaluateFlags;
|
||||||
property FirstIndexOffs: Int64 read GetFirstIndexOffs;
|
property FirstIndexOffs: Int64 read GetFirstIndexOffs;
|
||||||
@ -258,7 +256,6 @@ type
|
|||||||
property Expression: String read GetExpression;
|
property Expression: String read GetExpression;
|
||||||
|
|
||||||
property Validity: TDebuggerDataState read GetValidity write SetValidity;
|
property Validity: TDebuggerDataState read GetValidity write SetValidity;
|
||||||
property Value: String read GetValue write SetValue;
|
|
||||||
property TypeInfo: TDBGTypeBase {read GetTypeInfo} write SetTypeInfo;
|
property TypeInfo: TDBGTypeBase {read GetTypeInfo} write SetTypeInfo;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2561,9 +2561,11 @@ procedure TLldbDebuggerCommandEvaluate.EvalInstructionSucceeded(Sender: TObject
|
|||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
if FWatchValue <> nil then begin
|
if FWatchValue <> nil then begin
|
||||||
FWatchValue.Value := FInstr.Res;
|
FWatchValue.BeginUpdate;
|
||||||
|
FWatchValue.ResData.CreatePrePrinted(FInstr.Res);
|
||||||
//FWatchValue.TypeInfo := TypeInfo;
|
//FWatchValue.TypeInfo := TypeInfo;
|
||||||
FWatchValue.Validity := ddsValid;
|
FWatchValue.Validity := ddsValid;
|
||||||
|
FWatchValue.EndUpdate;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if FCallback <> nil then
|
if FCallback <> nil then
|
||||||
|
@ -93,7 +93,6 @@ type
|
|||||||
function GetTypeInfo: TDBGType; override;
|
function GetTypeInfo: TDBGType; override;
|
||||||
function GetValidity: TDebuggerDataState; override;
|
function GetValidity: TDebuggerDataState; override;
|
||||||
function GetValue: String; override;
|
function GetValue: String; override;
|
||||||
procedure SetValue(AValue: String); override;
|
|
||||||
public
|
public
|
||||||
constructor Create(AOwnerWatch: TWatch;
|
constructor Create(AOwnerWatch: TWatch;
|
||||||
const AThreadId: Integer;
|
const AThreadId: Integer;
|
||||||
@ -478,13 +477,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTestWatchValue.SetValue(AValue: String);
|
|
||||||
begin
|
|
||||||
BeginUpdate;
|
|
||||||
ResData.CreatePrePrinted(AValue);
|
|
||||||
EndUpdate;
|
|
||||||
end;
|
|
||||||
|
|
||||||
constructor TTestWatchValue.Create(AOwnerWatch: TWatch; const AThreadId: Integer;
|
constructor TTestWatchValue.Create(AOwnerWatch: TWatch; const AThreadId: Integer;
|
||||||
const AStackFrame: Integer);
|
const AStackFrame: Integer);
|
||||||
begin
|
begin
|
||||||
|
@ -783,7 +783,6 @@ type
|
|||||||
FSnapShot: TIdeWatchValue;
|
FSnapShot: TIdeWatchValue;
|
||||||
procedure SetSnapShot(const AValue: TIdeWatchValue);
|
procedure SetSnapShot(const AValue: TIdeWatchValue);
|
||||||
protected
|
protected
|
||||||
procedure SetValue(AValue: String); override; // TODO: => one per DisplayFormat???
|
|
||||||
procedure SetWatch(AValue: TWatch); override;
|
procedure SetWatch(AValue: TWatch); override;
|
||||||
function GetBackendExpression: String; reintroduce;
|
function GetBackendExpression: String; reintroduce;
|
||||||
function GetValidity: TDebuggerDataState; override;
|
function GetValidity: TDebuggerDataState; override;
|
||||||
@ -4150,13 +4149,6 @@ begin
|
|||||||
then FSnapShot.Assign(self);
|
then FSnapShot.Assign(self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCurrentWatchValue.SetValue(AValue: String);
|
|
||||||
begin
|
|
||||||
BeginUpdate;
|
|
||||||
ResData.CreatePrePrinted(AValue);
|
|
||||||
EndUpdate;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCurrentWatchValue.SetWatch(AValue: TWatch);
|
procedure TCurrentWatchValue.SetWatch(AValue: TWatch);
|
||||||
begin
|
begin
|
||||||
CancelRequestData;
|
CancelRequestData;
|
||||||
|
@ -78,7 +78,6 @@ type
|
|||||||
function GetThreadId: Integer;
|
function GetThreadId: Integer;
|
||||||
function GetValidity: TDebuggerDataState; virtual;
|
function GetValidity: TDebuggerDataState; virtual;
|
||||||
procedure SetValidity(AValue: TDebuggerDataState); virtual;
|
procedure SetValidity(AValue: TDebuggerDataState); virtual;
|
||||||
procedure SetValue(AValue: String); virtual;
|
|
||||||
procedure SetTypeInfo(AValue: TDBGType);
|
procedure SetTypeInfo(AValue: TDBGType);
|
||||||
procedure SetTypeInfo(AValue: TDBGTypeBase);
|
procedure SetTypeInfo(AValue: TDBGTypeBase);
|
||||||
|
|
||||||
@ -113,7 +112,7 @@ type
|
|||||||
public
|
public
|
||||||
property Watch: TWatch read FWatch write SetWatch;
|
property Watch: TWatch read FWatch write SetWatch;
|
||||||
property Validity: TDebuggerDataState read GetValidity write SetValidity;
|
property Validity: TDebuggerDataState read GetValidity write SetValidity;
|
||||||
property Value: String read GetValue write SetValue;
|
property Value: String read GetValue;
|
||||||
property TypeInfo: TDBGType read GetTypeInfo write SetTypeInfo;
|
property TypeInfo: TDBGType read GetTypeInfo write SetTypeInfo;
|
||||||
property ResultData: TWatchResultData read GetResultData;
|
property ResultData: TWatchResultData read GetResultData;
|
||||||
end;
|
end;
|
||||||
@ -462,11 +461,6 @@ begin
|
|||||||
Result := FThreadId;
|
Result := FThreadId;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWatchValue.SetValue(AValue: String);
|
|
||||||
begin
|
|
||||||
assert(False, 'TWatchValue.SetValue: False');
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TWatchValue.SetTypeInfo(AValue: TDBGType);
|
procedure TWatchValue.SetTypeInfo(AValue: TDBGType);
|
||||||
begin
|
begin
|
||||||
//assert(Self is TCurrentWatchValue, 'TWatchValue.SetTypeInfo');
|
//assert(Self is TCurrentWatchValue, 'TWatchValue.SetTypeInfo');
|
||||||
|
Loading…
Reference in New Issue
Block a user