[PATCH] [dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump.

Frederic Riss friss at apple.com
Thu Oct 16 09:12:39 PDT 2014


================
Comment at: lib/DebugInfo/DWARFDebugInfoEntry.cpp:154
@@ -134,1 +153,3 @@
         OS << " \"" << Ref << '\"';
+  } else if (attr == DW_AT_ranges) {
+    dumpRanges(OS, getAddressRanges(u), u->getAddressByteSize(),
----------------
dblaikie wrote:
> What's the failure mode if DW_AT_ranges isn't an index, or is not a correct index? (outside the range of ranges, etc)
Depends on the case. Something really wrong will get you a empty range list thus you'll get the same output as before (this is all handled in getAddressRanges and the helpers it calls). A random index pointing into the range list section will dump... random values, but I guess that's expected.

================
Comment at: test/DebugInfo/dwarfdump-ranges.test:16
@@ +15,3 @@
+CHECK-NEXT:          [0x0000000000000637 - 0x000000000000063d)
+CHECK-NEXT:          End)
+
----------------
dblaikie wrote:
> I'd probably skip the "End" word and just put ")" on the end of the previous line - given the consistent ending, line length, etc, it should be pretty obvious.
> 
> But I'm open to other ideas. 
> 
> What does Darwin's dwarfdump formatting for this look like?
The End is there only to match Darwin's dwarfdump. I can drop it if you prefer.

http://reviews.llvm.org/D5712






More information about the llvm-commits mailing list