mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 23:20:38 +02:00
FpDebug: Fallback to read size of enumeration from nested type
This commit is contained in:
parent
c29e9d7815
commit
ac8d539950
@ -908,6 +908,7 @@ DECL = DW_AT_decl_column, DW_AT_decl_file, DW_AT_decl_line
|
||||
procedure CreateMembers;
|
||||
protected
|
||||
procedure KindNeeded; override;
|
||||
function DoReadSize(const AValueObj: TFpValue; out ASize: TFpDbgValueSize): Boolean; override;
|
||||
function GetNestedSymbolEx(AIndex: Int64; out AnParentTypeSymbol: TFpSymbolDwarfType): TFpSymbol; override;
|
||||
function GetNestedSymbolExByName(const AIndex: String; out AnParentTypeSymbol: TFpSymbolDwarfType): TFpSymbol; override;
|
||||
function GetNestedSymbolCount: Integer; override;
|
||||
@ -6015,6 +6016,21 @@ begin
|
||||
SetKind(skEnum);
|
||||
end;
|
||||
|
||||
function TFpSymbolDwarfTypeEnum.DoReadSize(const AValueObj: TFpValue; out ASize: TFpDbgValueSize
|
||||
): Boolean;
|
||||
var
|
||||
n: TFpSymbolDwarfType;
|
||||
begin
|
||||
Result := inherited DoReadSize(AValueObj, ASize);
|
||||
|
||||
// Starting with DWARF-5 the size is optional and may be gotten from the embedded type
|
||||
if not Result then begin
|
||||
n := NestedTypeInfo;
|
||||
if n <> nil then
|
||||
Result := n.DoReadSize(AValueObj, ASize);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFpSymbolDwarfTypeEnum.GetNestedSymbolEx(AIndex: Int64; out AnParentTypeSymbol: TFpSymbolDwarfType): TFpSymbol;
|
||||
begin
|
||||
CreateMembers;
|
||||
|
Loading…
Reference in New Issue
Block a user