DWARF_FDE_CFA_OFFSET(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… DWARF_FDE_CFA_OFFSET πŸ’…

okay so bestie, welcome to the dwarf_fde_cfa_offset page β€” it lives in the DWARF Access Library (that's libdwarf, and you link it with -ldwarf, mwah). This is the manpage that tells you how to add a DW_CFA_offset frame instruction to a DWARF frame descriptor. iconic behavior honestly.


✨ NAME ✨

dwarf_fde_cfa_offset β€” add a DW_CFA_offset frame instruction to a DWARF frame descriptor πŸŽ€

πŸ“š LIBRARY πŸ“š

DWARF Access Library (libdwarf, -ldwarf) πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libdwarf.h>

Dwarf_P_Fde
dwarf_fde_cfa_offset(Dwarf_P_Fde fde, Dwarf_Unsigned reg,
    Dwarf_Signed offset, Dwarf_Error *err);

like, that's the whole vibe. three args plus an error slot. slay.

🌸 DESCRIPTION 🌸

So. Function dwarf_fde_cfa_offset() appends a DW_CFA_offset frame instruction onto the frame descriptor that argument fde is pointing at. it's giving "add one (1) instruction, no drama."

Argument fde should reference a frame descriptor that was allocated using dwarf_new_fde(3) β€” like, that's the expected provenance, don't come at it with a random pointer bestie 😭

Argument reg specifies the register operand for the frame instruction. that's the register. that's its whole job.

Argument offset specifies the offset operand for the frame instruction. yes ma'am, the offset. 🌈

If argument err is not NULL, it will be used to store error information in case of an error. super handy, and if you pass NULL you just don't get the tea. πŸ™ˆ

πŸ‘‘ RETURN VALUES πŸ‘‘

On success, function dwarf_fde_cfa_offset() returns the frame descriptor given in argument fde β€” yes, it just hands your own fde right back to you, that's the whole personality πŸ’…

In case of an error, function dwarf_fde_cfa_offset() returns DW_DLV_BADADDR and sets the argument err. so if you see DW_DLV_BADADDR, that's the πŸ’€ moment, go check err.

πŸ”₯ ERRORS πŸ”₯

Function dwarf_fde_cfa_offset() can fail with:

  • [DW_DLE_ARGUMENT] β€” Argument fde was NULL. (bestie. it was null. 😭)
  • [DW_DLE_MEMORY] β€” An out of memory condition was encountered during the execution of the function. (the machine simply said no 🫠)

⭐ SEE ALSO ⭐

go read the whole friend group, iykyk 🧚


and that's the page!! muah πŸ’œ this one's from the Debian crew, dated September 26, 2011</>, and it's filed under DWARF_FDE_CFA_OFFSET(3) β€” stan. πŸ“

πŸ“¦ where this page comes from