[PATCH] D37123: [dwarfdump] Pretty print location expressions and location lists

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 13:13:30 PDT 2017


rnk added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:248-251
+    // The compile unit is wrong, but the same dirty trick is used in
+    // getDebugLoc().
+    if (getNumCompileUnits())
+      getDebugLoc()->dump(OS, getCompileUnitAtIndex(0));
----------------
rnk wrote:
> When I tried factoring out the base address patch, I ran into this comment. How would we do this correctly? What scenario would cause us to pick the wrong compile unit? Picking the wrong compile unit would add the wrong base address to the .debug_loc entries.
I've convinced myself that this code is wrong and we actually have a test in tree for this. It doesn't test the two-CU location list case, though, so it wasn't obvious to me that this was wrong.

I'll revert this change. Most of the value is in the expression printing, not the base address change.


https://reviews.llvm.org/D37123





More information about the llvm-commits mailing list