[Dwarf-discuss] DW_AT_frame_base

Vsevolod Alekseyev sevaa@sprynet.com
Mon Sep 18 14:08:22 GMT 2023


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.

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dwarfstd.org/pipermail/dwarf-discuss/attachments/20230918/137c5c2e/attachment.htm>


More information about the Dwarf-discuss mailing list