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

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 15:34:06 PDT 2017


rnk created this revision.
Herald added subscribers: JDevlieghere, hiraditya, javed.absar, mgorny.

Based on Fred's patch here: https://reviews.llvm.org/D6771

I can't seem to commandeer the old review, so I'm creating a new one.

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 without ranges are printed inline:

  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.


https://reviews.llvm.org/D37123

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
  llvm/include/llvm/DebugInfo/DWARFExpression.h
  llvm/lib/DebugInfo/DWARF/CMakeLists.txt
  llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
  llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
  llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
  llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
  llvm/test/CodeGen/ARM/debug-info-sreg2.ll
  llvm/test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll
  llvm/test/DebugInfo/Generic/incorrect-variable-debugloc1.ll
  llvm/test/DebugInfo/SystemZ/variable-loc.ll
  llvm/test/DebugInfo/X86/DW_AT_location-reference.ll
  llvm/test/DebugInfo/X86/block-capture.ll
  llvm/test/DebugInfo/X86/data_member_location.ll
  llvm/test/DebugInfo/X86/debug-info-blocks.ll
  llvm/test/DebugInfo/X86/fission-cu.ll
  llvm/test/DebugInfo/X86/pieces-1.ll
  llvm/test/DebugInfo/X86/template.ll
  llvm/test/DebugInfo/dwarfdump-debug-loc-simple.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37123.112622.patch
Type: text/x-patch
Size: 48078 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170824/4617a800/attachment.bin>


More information about the llvm-commits mailing list