DWARF_FORMUDATA(3)

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

okay bestie, welcome to DWARF_FORMUDATA(3) from the Library Functions Manual β€” this one is all about pulling a constant value out of a DWARF attribute, and it's lowkey iconic. πŸ’–


✨ NAME ✨

dwarf_formudata, dwarf_formsdata β€” return the value of a CONSTANT class attribute

πŸŽ€ LIBRARY πŸŽ€

DWARF Access Library (libdwarf, -ldwarf)

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libdwarf.h>

int
dwarf_formudata(Dwarf_Attribute attr, Dwarf_Unsigned *ret,
    Dwarf_Error *err);

int
dwarf_formsdata(Dwarf_Attribute attr, Dwarf_Signed *ret,
    Dwarf_Error *err);

πŸ’… DESCRIPTION πŸ’…

So, these functions return the value associated with a DWARF attribute that describes a constant. Main character behavior, honestly. ✨

dwarf_formudata() sets the location pointed to by argument ret to the value of the attribute referenced by argument attr, treating that value as an unsigned quantity. Argument attr must have one of these forms, no cap:

  • DW_FORM_data1
  • DW_FORM_data2
  • DW_FORM_data4
  • DW_FORM_data8
  • DW_FORM_udata

dwarf_formsdata() sets the location pointed to by argument ret to the value of the attribute referenced by argument attr, appropriately sign extended. Argument attr must have one of these forms:

  • DW_FORM_data1
  • DW_FORM_data2
  • DW_FORM_data4
  • DW_FORM_data8
  • DW_FORM_sdata

If argument err is not NULL, it will be used to return an error descriptor in case of an error. Very "keep your receipts" of it all. 🧾

🌈 RETURN VALUES 🌈

These functions return DW_DLV_OK on success. In case of an error, they return DW_DLV_ERROR and set argument err. That's the whole vibe check. πŸ’«

πŸ’€ ERRORS πŸ’€

These functions may fail with the following errors:

  • [DW_DLE_ARGUMENT] β€” Either of arguments attr or ret was NULL.
  • [DW_DLE_ATTR_FORM_BAD] β€” The attribute referenced by argument attr was not of a permitted kind.

πŸ‘‘ SEE ALSO πŸ‘‘

dwarf(3), dwarf_attr(3), dwarf_formblock(3), dwarf_formflag(3), dwarf_formref(3), dwarf_formsig8(3), dwarf_formstring(3), dwarf_hasattr(3)


mwah πŸ’‹ this lil masterpiece is from Debian, dated June 21, 2010, and its iconic header/footer name is DWARF_FORMUDATA(3) β€” periodt. 🫢

πŸ“¦ where this page comes from