[PATCH] D154638: Emit a .debug_addr section with dsymutil
Alexey Lapshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 20 14:50:46 PDT 2023
avl added a comment.
Thank you for the update! I think it is mostly done. Please, check two small things in inline comments.
================
Comment at: llvm/lib/DWARFLinker/DWARFLinker.cpp:1398
+
+ return AttrSize;
}
----------------
It would be incorrect to return size of original attribute here.
Instead we need to calculate size of DW_FORM_addrx:
```
unsigned NewAttrSize = Die.addValue(DIEAlloc, static_cast<dwarf::Attribute>(AttrSpec.Attr),
dwarf::Form::DW_FORM_addrx, DIEInteger(AddrIndex))->sizeOf(OrigUnit.getFormParams());
return NewAttrSize;
```
================
Comment at: llvm/test/tools/llvm-dwarfutil/ELF/X86/dwarf5-addresses.test:44
#DWARF-CHECK: DW_AT_name [DW_FORM_strp] {{.*}} "foo4"
-#DWARF-CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000001160)
+#DWARF-CHECK: DW_AT_low_pc [DW_FORM_addrx1] (indexed (00000003) address = 0x0000000000001160)
#DWARF-CHECK: DW_AT_high_pc [DW_FORM_data8] (0x0000000000000010)
----------------
should not it be DW_FORM_addrx here and in following cases?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154638/new/
https://reviews.llvm.org/D154638
More information about the llvm-commits
mailing list