mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 20:59:08 +02:00
Debugger: fix typename with Json-display
This commit is contained in:
parent
3b0a985ae7
commit
cbb17d6aeb
@ -370,7 +370,10 @@ begin
|
|||||||
AnchType := '';
|
AnchType := '';
|
||||||
if Res.Anchestor <> nil then
|
if Res.Anchestor <> nil then
|
||||||
AnchType := Res.Anchestor.TypeName;
|
AnchType := Res.Anchestor.TypeName;
|
||||||
StatusBar1.SimpleText:=Format(lisInspectClassInherit, [ShortenedExpression, Res.TypeName, AnchType]);
|
if (Res.ValueKind = rdkStruct) and (AnchType <> '') then
|
||||||
|
StatusBar1.SimpleText:=Format(lisInspectClassInherit, [ShortenedExpression, Res.TypeName, AnchType])
|
||||||
|
else
|
||||||
|
StatusBar1.SimpleText:=ShortenedExpression+' : '+Res.TypeName + ' = ' + FHumanReadable;
|
||||||
|
|
||||||
GridDataSetup;
|
GridDataSetup;
|
||||||
FldCnt := 0;
|
FldCnt := 0;
|
||||||
|
@ -277,6 +277,9 @@ begin
|
|||||||
|
|
||||||
if (Result.ValueKind in [rdkString, rdkPrePrinted]) and (IsMaybeJson(Result.AsString)) then begin
|
if (Result.ValueKind in [rdkString, rdkPrePrinted]) and (IsMaybeJson(Result.AsString)) then begin
|
||||||
FResultDataSpecialised := TWatchResultDataJSon.Create(Result.AsString);
|
FResultDataSpecialised := TWatchResultDataJSon.Create(Result.AsString);
|
||||||
|
TWatchResultDataJSon(FResultDataSpecialised).SetTypeName(FResultData.TypeName);
|
||||||
|
if FResultData.HasDataAddress then
|
||||||
|
TWatchResultDataJSon(FResultDataSpecialised).SetDataAddress(FResultData.DataAddress);
|
||||||
if (FResultDataSpecialised.Count > 0) or (FResultDataSpecialised.FieldCount > 0) then
|
if (FResultDataSpecialised.Count > 0) or (FResultDataSpecialised.FieldCount > 0) then
|
||||||
FResultDataContent := rdcJSon;
|
FResultDataContent := rdcJSon;
|
||||||
end;
|
end;
|
||||||
|
@ -96,6 +96,15 @@ type
|
|||||||
TWatchResultValueString = object(TWatchResultValueTextBase)
|
TWatchResultValueString = object(TWatchResultValueTextBase)
|
||||||
protected const
|
protected const
|
||||||
VKind = rdkString;
|
VKind = rdkString;
|
||||||
|
private
|
||||||
|
FAddress: TDBGPtr;
|
||||||
|
protected
|
||||||
|
procedure LoadDataFromXMLConfig(const AConfig: TXMLConfig; const APath: string;
|
||||||
|
const AnEntryTemplate: TWatchResultData;
|
||||||
|
var AnOverrideTemplate: TOverrideTemplateData;
|
||||||
|
AnAsProto: Boolean);
|
||||||
|
procedure SaveDataToXMLConfig(const AConfig: TXMLConfig; const APath: string; AnAsProto: Boolean);
|
||||||
|
property GetDataAddress: TDBGPtr read FAddress;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TWatchResultValueWideString }
|
{ TWatchResultValueWideString }
|
||||||
@ -1000,6 +1009,9 @@ type
|
|||||||
TWatchResultDataString = class(specialize TGenericWatchResultData<TWatchResultValueString>)
|
TWatchResultDataString = class(specialize TGenericWatchResultData<TWatchResultValueString>)
|
||||||
private
|
private
|
||||||
function GetClassID: TWatchResultDataClassID; override;
|
function GetClassID: TWatchResultDataClassID; override;
|
||||||
|
protected
|
||||||
|
function GetHasDataAddress: Boolean; override;
|
||||||
|
function GetDataAddress: TDBGPtr; override;
|
||||||
public
|
public
|
||||||
constructor Create(AStringVal: String);
|
constructor Create(AStringVal: String);
|
||||||
end;
|
end;
|
||||||
@ -1594,6 +1606,24 @@ begin
|
|||||||
AConfig.SetValue(APath + 'Value', FText);
|
AConfig.SetValue(APath + 'Value', FText);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TWatchResultValueString }
|
||||||
|
|
||||||
|
procedure TWatchResultValueString.LoadDataFromXMLConfig(
|
||||||
|
const AConfig: TXMLConfig; const APath: string;
|
||||||
|
const AnEntryTemplate: TWatchResultData;
|
||||||
|
var AnOverrideTemplate: TOverrideTemplateData; AnAsProto: Boolean);
|
||||||
|
begin
|
||||||
|
inherited LoadDataFromXMLConfig(AConfig, APath, AnEntryTemplate, AnOverrideTemplate, AnAsProto);
|
||||||
|
FAddress := TDBGPtr(AConfig.GetValue(APath + 'Addr', 0));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TWatchResultValueString.SaveDataToXMLConfig(
|
||||||
|
const AConfig: TXMLConfig; const APath: string; AnAsProto: Boolean);
|
||||||
|
begin
|
||||||
|
inherited SaveDataToXMLConfig(AConfig, APath, AnAsProto);
|
||||||
|
AConfig.SetDeleteValue(APath + 'Addr', Int64(FAddress), 0);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TWatchResultValueWideString }
|
{ TWatchResultValueWideString }
|
||||||
|
|
||||||
function TWatchResultValueWideString.GetAsString: String;
|
function TWatchResultValueWideString.GetAsString: String;
|
||||||
@ -3288,6 +3318,16 @@ begin
|
|||||||
Result := wdString;
|
Result := wdString;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TWatchResultDataString.GetHasDataAddress: Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TWatchResultDataString.GetDataAddress: TDBGPtr;
|
||||||
|
begin
|
||||||
|
Result := FData.GetDataAddress;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TWatchResultDataString.Create(AStringVal: String);
|
constructor TWatchResultDataString.Create(AStringVal: String);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
@ -12,7 +12,7 @@ type
|
|||||||
|
|
||||||
{ TWatchResultDataJSonBase }
|
{ TWatchResultDataJSonBase }
|
||||||
|
|
||||||
TWatchResultDataJSonBase = class(TWatchResultDataPrePrinted)
|
TWatchResultDataJSonBase = class(TWatchResultDataString)
|
||||||
private
|
private
|
||||||
FInternalJSon: TJSONData;
|
FInternalJSon: TJSONData;
|
||||||
FIndex: Integer;
|
FIndex: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user