Issue 161128.1: Add an example for DW_OP_bit_piece to D.1.3 (DWARF Location Description Examples

Author: Adrian Prantl
Champion: Adrian Prantl
Date submitted: 2016-11-28
Date revised:
Date closed:
Type: Clarification
Status: Accepted
DWARF Version: 5
Section D.1.3, pg 288
There are currently no examples of how to correctly use DW_OP_bit_piece.
I recently discovered that I mis-implemented DW_OP_bit_piece in LLVM and I believe that
having and example like the following would have helped avoid this.

I suggest adding the following example to D.1.3 (DWARF Location Description Examples):

DW_OP_reg0 DW_OP_bit_piece 1 31 DW_OP_bit_piece 7 0 DW_OP_reg1 DW_OP_piece 1

A variable whose first bit resides in the 31st bit of register 0, whose next 
seven bits are undefined and whose second byte resides in register 1.

12/06/2016 -- Accepted.