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

Frederic Riss friss at apple.com
Tue Dec 23 10:53:34 PST 2014


Hi dblaikie, samsonov,

With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:

    DW_AT_location [DW_FORM_data4]        (0x00000000
       0x0000000000000001 - 0x000000000000000b: OP_consts +3
       0x000000000000000b - 0x0000000000000012: OP_consts +7
       0x0000000000000012 - 0x000000000000001b: OP_reg0 RAX, OP_piece 0x00000004
       0x000000000000001b - 0x0000000000000024: OP_breg5 RDI+0)

And like this for debug_loc.dwo entries:
    DW_AT_location [DW_FORM_sec_offset]   (0x00000000
      Addr idx 2 (w/ length 190): OP_consts +0, OP_stack_value
      Addr idx 3 (w/ length 23): OP_reg0 RAX, OP_piece 0x00000004)

Simple locations wihtout ranges are sumped inlie to:

   DW_AT_location [DW_FORM_block1]       (OP_reg4 RSI, OP_piece 0x00000004, OP_bit_piece 0x00000020 0x00000000)

The debug_loc(.dwo) dumping in changed accordingly to factor the code.

I've been sitting on this for much too long, and I'm not totally satisfied
with the code. For example, the detection of wether to use DWO or standard
lcoations in DebugInfoEntryMinimal doesn't look right. Ideas welcome (one
idea would be to have virtual DebugLoc objects and to store that in the
DWARFUnitSection, but it feels slightly over-engineered for the purpose).
The patch also isn't ready to apply as-is. It requires a few preliminary
patches like landing D6243 and adding a MCRegisterInfo in the  DWARFContext,
but I've left that out here in favor of the dumping related changes.

Happy Christmas!

http://reviews.llvm.org/D6771

Files:
  lib/DebugInfo/CMakeLists.txt
  lib/DebugInfo/DWARFContext.cpp
  lib/DebugInfo/DWARFContext.h
  lib/DebugInfo/DWARFDebugInfoEntry.cpp
  lib/DebugInfo/DWARFDebugLoc.cpp
  lib/DebugInfo/DWARFDebugLoc.h
  lib/DebugInfo/DWARFExpression.cpp
  lib/DebugInfo/DWARFExpression.h
  test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
  test/CodeGen/ARM/2011-08-02-MergedGlobalDbg.ll
  test/CodeGen/ARM/debug-info-sreg2.ll
  test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll
  test/DebugInfo/AArch64/coalescing.ll
  test/DebugInfo/ARM/s-super-register.ll
  test/DebugInfo/SystemZ/variable-loc.ll
  test/DebugInfo/X86/DW_AT_location-reference.ll
  test/DebugInfo/X86/block-capture.ll
  test/DebugInfo/X86/data_member_location.ll
  test/DebugInfo/X86/dbg-merge-loc-entry.ll
  test/DebugInfo/X86/dbg-value-const-byref.ll
  test/DebugInfo/X86/debug-info-blocks.ll
  test/DebugInfo/X86/debug-loc-offset.ll
  test/DebugInfo/X86/fission-cu.ll
  test/DebugInfo/X86/fission-ranges.ll
  test/DebugInfo/X86/op_deref.ll
  test/DebugInfo/X86/parameters.ll
  test/DebugInfo/X86/pieces-1.ll
  test/DebugInfo/X86/pieces-2.ll
  test/DebugInfo/X86/pieces-3.ll
  test/DebugInfo/X86/subregisters.ll
  test/DebugInfo/X86/template.ll
  test/DebugInfo/dwarfdump-debug-loc-simple.test
  test/DebugInfo/incorrect-variable-debugloc1.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6771.17601.patch
Type: text/x-patch
Size: 50405 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141223/9db9f1c0/attachment.bin>


More information about the llvm-commits mailing list