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.
Worth switching this from 'unsigned char' to 'char' to avoid the conversions back and forth on reading/writing? (more compatible with DataExtractor, etc)