[llvm-bugs] [Bug 45009] New: LLVM emits invalid entry values covering composite location descriptions
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Feb 24 08:19:26 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=45009
Bug ID: 45009
Summary: LLVM emits invalid entry values covering composite
location descriptions
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: DebugInfo
Assignee: unassignedbugs at nondot.org
Reporter: david.stenberg at ericsson.com
CC: jdevlieghere at apple.com, keith.walker at arm.com,
llvm-bugs at lists.llvm.org,
paul_robinson at playstation.sony.com
When working on D67492 I made DwarfExpression emit a single DW_OP_entry_value
operation covering the whole composite location description that is produced if
a register does not have a valid DWARF number, and is instead composed of
multiple sub-registers. Looking closer at the standard, I noticed that that is
not valid DWARF. A DW_OP_entry_value operation's block can only be a DWARF
expression or a register location description, so it is not valid to hold a
composite location description like that. See DWARFv5 sec. 2.5.1.7:
"The DW_OP_entry_value operation pushes the value that the described location
held upon entering the current subprogram. It has two operands: an unsigned
LEB128 length, followed by a block containing a DWARF expression or a register
location description (see Section 2.6.1.1.3 on page 39)."
Such a case can be seen in
llvm/test/DebugInfo/Sparc/entry-value-complex-reg-expr.ll.
Perhaps we instead want to emit expressions containing one DW_OP_entry_value
operation per sub-register, e.g.:
DW_OP_entry_value(DW_OP_regx D0), DW_OP_piece 0x8,
DW_OP_entry_value(DW_OP_regx D1), DW_OP_piece 0x8,
DW_OP_stack_value
However, it is a bit unclear how the call site location should be for that;
should we emit one entry per sub-register, or a single composite location and
let the debugger figure out how the two expressions correlate? It is unclear to
me if it is valid DWARF to have
multiple entries per parameter. The
latter should be valid DWARF, but AFAICT no debugger can understand such call
site locations at the moment. GDB can only understand single DW_OP_reg or
DW_OP_fbreg locations.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200224/d8a14597/attachment.html>
More information about the llvm-bugs
mailing list