mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-13 23:52:35 +02:00
* Dwarf: write enum symbol constants with the size of the enum, as proposed in #41021
This commit is contained in:
parent
23875bd8c4
commit
eba0624535
@ -1504,6 +1504,7 @@ implementation
|
||||
var
|
||||
hp : tenumsym;
|
||||
i : integer;
|
||||
entryform : Tdwarf_form;
|
||||
begin
|
||||
if assigned(def.typesym) then
|
||||
append_entry(DW_TAG_enumeration_type,true,[
|
||||
@ -1518,6 +1519,19 @@ implementation
|
||||
append_labelentry_ref(DW_AT_type,def_dwarf_lab(def.basedef));
|
||||
finish_entry;
|
||||
|
||||
case def.size of
|
||||
1:
|
||||
entryform:=DW_FORM_data1;
|
||||
2:
|
||||
entryform:=DW_FORM_data2;
|
||||
4:
|
||||
entryform:=DW_FORM_data4;
|
||||
8:
|
||||
entryform:=DW_FORM_data8;
|
||||
else
|
||||
Internalerror(2025041601);
|
||||
end;
|
||||
|
||||
{ write enum symbols }
|
||||
for i := 0 to def.symtable.SymList.Count - 1 do
|
||||
begin
|
||||
@ -1529,7 +1543,7 @@ implementation
|
||||
break;
|
||||
append_entry(DW_TAG_enumerator,false,[
|
||||
DW_AT_name,DW_FORM_string,symname(hp, false)+#0,
|
||||
DW_AT_const_value,DW_FORM_data4,hp.value
|
||||
DW_AT_const_value,entryform,hp.value
|
||||
]);
|
||||
finish_entry;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user