[PATCH] D84921: [DWARFYAML] Make the debug_aranges entry optional.

Xing GUO via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 02:34:15 PDT 2020


Higuoxing added inline comments.


================
Comment at: llvm/tools/obj2yaml/dwarf2yaml.cpp:67
   DWARFDebugArangeSet Set;
-
+  std::vector<DWARFYAML::ARange> DebugAranges;
   while (ArangesData.isValidOffset(Offset)) {
----------------
jhenderson wrote:
> It seems to me like you don't need this vector? Could you do `Y.DebugAranges.emplace()` to instantiate the vector in this case?
Actually I do it deliberately here. IMHO, if the parser encounters an error below, debug_aranges entry should keep empty.

In the implementation of adding DWARF support to elf2yaml, the basic idea is that firstly, we try to parse DWARF sections into the "DWARF:" entry, if the parser fails, elf2yaml will consume that error and continue to dump it as raw content. If we don't do it here, the "DWARF:" will have an incomplete section.

Shall we wait for the patch that adds DWARF support to elf2yaml to see if it works?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84921/new/

https://reviews.llvm.org/D84921



More information about the llvm-commits mailing list