[PATCH] D104005: [DWARFYAML] make obj2yaml use existing DWARF support for ELF
Josh Haberman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 9 19:23:23 PDT 2021
haberman created this revision.
haberman added reviewers: Higuoxing, jhenderson.
haberman requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
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).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D104005
Files:
llvm/tools/obj2yaml/elf2yaml.cpp
Index: llvm/tools/obj2yaml/elf2yaml.cpp
===================================================================
--- llvm/tools/obj2yaml/elf2yaml.cpp
+++ llvm/tools/obj2yaml/elf2yaml.cpp
@@ -489,14 +489,18 @@
Error Err = Error::success();
cantFail(std::move(Err));
- if (RawSec->Name == ".debug_aranges")
+ if (RawSec->Name == ".debug_abbrev")
+ dumpDebugAbbrev(*DWARFCtx.get(), DWARF);
+ else if (RawSec->Name == ".debug_addr")
+ Err = dumpDebugAddr(*DWARFCtx.get(), DWARF);
+ else if (RawSec->Name == ".debug_aranges")
Err = dumpDebugARanges(*DWARFCtx.get(), DWARF);
+ else if (RawSec->Name == ".debug_info")
+ dumpDebugInfo(*DWARFCtx.get(), DWARF);
else if (RawSec->Name == ".debug_str")
Err = dumpDebugStrings(*DWARFCtx.get(), DWARF);
else if (RawSec->Name == ".debug_ranges")
Err = dumpDebugRanges(*DWARFCtx.get(), DWARF);
- else if (RawSec->Name == ".debug_addr")
- Err = dumpDebugAddr(*DWARFCtx.get(), DWARF);
else
continue;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104005.351043.patch
Type: text/x-patch
Size: 1060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210610/f697c451/attachment.bin>
More information about the llvm-commits
mailing list