[PATCH] Fix the remainder of PR22762 (GDB is crashing on DW_OP_piece being used inside of DW_AT_frame_base)
Adrian Prantl
aprantl at apple.com
Tue Mar 10 14:50:17 PDT 2015
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.", 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 --------------
A non-text attachment was scrubbed...
Name: D8233.21641.patch
Type: text/x-patch
Size: 7891 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150310/6cc73c93/attachment.bin>
More information about the llvm-commits
mailing list