A "location description [that] is a register operation" is the language in
DWARF v3; in later versions, it is "a simple register location description."
This means something like DW_OP_reg5, which is allowed in a location
description but not in a DWARF expression.
Form DW_FORM_data4, value 0, would be interpreted as a location list reference.
It is not by itself an address or a register location description.
--paulr
From: Dwarf-discuss
On Behalf Of
Vsevolod Alekseyev via Dwarf-discuss
Sent: Monday, September 18, 2023 10:08 AM
To: dwarf-discuss@lists.dwarfstd.org
Subject: [Dwarf-discuss] DW_AT_frame_base
Please help me interpret the DWARF spec regarding the DW_AT_frame_base. Quoted
by spec v3, section 3.5.5, but similar wording in v4 and v5:
"A subroutine or entry point entry may also have a DW_AT_frame_base attribute,
whose value is a location description that computes the "frame base" for the
subroutine or entry point. If the location description is a register operation,
the given register contains the frame base address. If the location description
is a DWARF expression, the result of evaluating that expression is the frame
base address. Finally, for a location list, this interpretation applies to each
location expression contained in the list of location list entries."
So what does "location description that is a register operation" mean here?
Since the option of a DWARF expression block is covered by the second option,
that rather suggests to me that "register operation" is not a DWARF operation.
I mean, the wording "if A is X, then Y. If A is P, then Q" usually means that P
is distinct from X, right?
On a more practical note, I'm currently staring at a crash report with a DWARF
attribute parsing failure. DWARF v3 Linux ELF binary, produced by NASM.
DW_AT_frame_base, form DW_FORM_data4, value 0. The code assumes it's a loclist
pointer, but the binary doesn't contain a loclist section.
Zero as a loclist pointer in a v3 binary could make sense. As a "register
operation" - I'm not sure. Could be a compiler quirk, but I'm admitting the
possibility that I'm misreading something.
--
Dwarf-discuss mailing list
Dwarf-discuss@lists.dwarfstd.org
https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss