FpDebug: Show "self" in locals window. Fpc encodes it as "this", so FpDebug must replace the name. Issue #39907 and part of issue #40000

This commit is contained in:
Martin 2023-02-04 13:00:19 +01:00
parent f7686f03f1
commit 60d221f23a

View File

@ -279,6 +279,12 @@ type
end;
{%EndRegion }
{ TFpSymbolDwarfFreePascalDataParameter }
TFpSymbolDwarfFreePascalDataParameter = class(TFpSymbolDwarfDataParameter)
procedure NameNeeded; override;
end;
implementation
uses
@ -406,6 +412,7 @@ begin
DW_TAG_class_type: Result := TFpSymbolDwarfFreePascalTypeStructure;
DW_TAG_array_type: Result := TFpSymbolDwarfFreePascalSymbolTypeArray;
DW_TAG_subprogram: Result := TFpSymbolDwarfFreePascalDataProc;
DW_TAG_formal_parameter: Result := TFpSymbolDwarfFreePascalDataParameter;
else Result := inherited GetDwarfSymbolClass(ATag);
end;
end;
@ -1911,6 +1918,15 @@ begin
{$EndIf}
end;
{ TFpSymbolDwarfFreePascalDataParameter }
procedure TFpSymbolDwarfFreePascalDataParameter.NameNeeded;
begin
inherited NameNeeded;
if InformationEntry.IsArtificial and (Name = 'this') then
SetName('self');
end;
initialization
DwarfSymbolClassMapList.AddMap(TFpDwarfFreePascalSymbolClassMapDwarf2);
DwarfSymbolClassMapList.AddMap(TFpDwarfFreePascalSymbolClassMapDwarf3);