This is an archive of the discontinued LLVM Phabricator instance.

[DWARFYAML] make obj2yaml use existing DWARF support for ELF
Needs ReviewPublic

Authored by haberman on Jun 9 2021, 7:23 PM.

Details

Summary

These DWARF routines were previously only used for Mach-O.
yaml2obj can handle these DWARF sections, but prior to this
change obj2yaml would not emit them (insted it would just
emit the raw bytes of the .debug_* sections).

Diff Detail

Event Timeline

haberman requested review of this revision.Jun 9 2021, 7:23 PM
haberman created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2021, 7:23 PM

As you see, the original DWARF parser is buggy and lacking of tests, so we haven't employed it in elf2yaml. You might need to modify the parser before adding it to elf2yaml. Could you please split this patch into several small patches and add some tests for it? Test cases for DWARF of elf2yaml are in llvm/test/tools/obj2yaml/ELF/DWARF (https://github.com/llvm/llvm-project/tree/main/llvm/test/tools/obj2yaml/ELF/DWARF).