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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 08:24:19 PDT 2020


dblaikie added inline comments.


================
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");
+  }
----------------
jhenderson wrote:
> 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?
> 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

I didn't quite follow this - could you explain that in more detail/other words? Specifically, yes, it would be difficult/annoying to hand-craft such an input, but what were the particular problems you hit when attempting to do so?


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