[PATCH] Fix the remainder of PR22762 (GDB is crashing on DW_OP_piece being used inside of DW_AT_frame_base)

David Blaikie dblaikie at gmail.com
Tue Mar 10 15:14:47 PDT 2015


On Tue, Mar 10, 2015 at 2:50 PM, Adrian Prantl <aprantl at apple.com> wrote:

> Hi echristo, dblaikie,
>
> http://llvm.org/bugs/show_bug.cgi?id=22762
> The symptom was that DW_AT_frame_base should never use a
> DW_OP_(bit)_piece, the bug was that AddMachineRegPiece incorrectly created
> pieces to describe values that occupy only a subregister. Change this to
> emit a bit mask instead.
>
> I'm posting this for review because emitting the bit mask increases the
> size occupied for DWARF expressions for sub-registers (~5 bytes for a
> 32-bit subregister). Previously we would (incorrectly!) use DW_OP_piece to
> describe a value occupying part of a register. However, "DW_OP_piece
> provides a way of describing how large a part of a variable a particular
> DWARF location description refers to.",


The spec also says "If the piece is located in a register, but does not
occupy the entire register, the placement of the piece within that register
is defined by the ABI. " - so we can use this in some cases at least.
Should we? I assume it just means if we say _piece of size 1 in a register
of size 4 we get the low byte (whatever definition of 'low' there is)?


> not the size and offset of an entire variable inside a super-register. The
> way that most debuggers implement DW_OP_piece this sort of works out for
> subregisters that are at offset 0, but it causes confusion if the
> expression needs to be composed (such as in DW_AT_frame_base, or if the
> subregister contains only a part of the variable).
>
> REPOSITORY
>   rL LLVM
>
> http://reviews.llvm.org/D8233
>
> Files:
>   lib/CodeGen/AsmPrinter/DwarfExpression.cpp
>   lib/CodeGen/AsmPrinter/DwarfExpression.h
>   test/CodeGen/ARM/debug-info-s16-reg.ll
>   test/CodeGen/ARM/debug-info-sreg2.ll
>   test/DebugInfo/ARM/s-super-register.ll
>   test/DebugInfo/X86/dbg-value-const-byref.ll
>   test/DebugInfo/X86/fission-ranges.ll
>   test/DebugInfo/X86/subreg.ll
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150310/034f8e7a/attachment.html>


More information about the llvm-commits mailing list