[PATCH] D78782: Add .debug_ranges support to the DWARF YAML.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 02:14:00 PDT 2020


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM, with one small request.



================
Comment at: llvm/tools/obj2yaml/dwarf2yaml.cpp:95-96
+    else if (CUAddrSize != AddrSize)
+      return createStringError(std::errc::invalid_argument,
+                               "address sizes vary in different compile units");
+  }
----------------
clayborg wrote:
> jhenderson wrote:
> > Test case?
> I tried to make a test case and ran into multiple issues:
> - I modified my DWARF generator to emit two different compile units with different address sizes but obj2yaml won't load the DWARF as the DWARF parser asserts when it tries to make the YAML by loading the DWARF
> - if I hand edit the YAML, section sizes change and all of the data is off since and there are the existing yaml2obj ignores a different AddrSize
> 
> This really never happens in reality. I had this as an assert before, but you requested the error. Since the DWARF parsing code already asserts on this issue, I would be fine if we did too here?
Sounds to me like the DWARF parser asserting is a bug in the code, but that's outside the scope of this patch. We shouldn't ever be able to hit asserts, however broken the input is. Could you add a TODO noting that this error is untested due to the parser asserting when it happens?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78782





More information about the llvm-commits mailing list