[PATCH] D33155: [DWARFv5] Support FORM_strp in the line table header

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 13:20:27 PDT 2017


probinson marked an inline comment as done.
probinson added inline comments.


================
Comment at: lib/DebugInfo/DWARF/DWARFContext.cpp:193-196
+    DWARFUnit *U = nullptr;
+    if (!CUs.empty())
+      U = &**CUs.begin();
+    while (LineTable.Prologue.parse(lineData, &stmtOffset, U)) {
----------------
dblaikie wrote:
> Guessing this probably isn't right for DWP files? Or potentially for a DWO containing multiple CUs that might have different CU properties that are relevant to the line table?
> 
> Though that's perhaps an interesting question - since a DWO line table is just for type units, the CU won't have a reference to any line.dwo section, and multiple DWO TUs might refer to the same line table, I think? (I think LLVM produces only one, but I forget - it's been awhile since I implemented taht) so you'd want to pick one of the DWO TUs that references this line table to use here?
There are no CU properties relevant to a DWO v5 line table.  The only reason we need a CU is because it is a convenient way to relay handles on the other sections that a v5 line table header might need (.debug_str etc).  So it doesn't matter whether the CU is related to the line table.

It's quite easy to argue that, therefore, we shouldn't pass a CU down at all, but something else that provides the same information.  I thought about that for a while, and decided that if we do go that route then probably it should be done as a separate commit, because all the existing APIs are expecting a CU.
What do you think?


https://reviews.llvm.org/D33155





More information about the llvm-commits mailing list