DWARF_HASFORM(3)

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

πŸ’– query attribute forms πŸ’–

okay so you're reading DWARF_HASFORM(3), a Library Functions Manual page from the DWARF Access Library (libdwarf, -ldwarf). It's giving β€œask questions about attribute forms” energy, and honestly? iconic. πŸ¦‹

🌸 NAME 🌸

dwarf_hasform, dwarf_whatform, dwarf_whatform_direct β€” the little trio for querying attribute forms. πŸ’…

πŸŽ€ LIBRARY πŸŽ€

DWARF Access Library (libdwarf, -ldwarf). 🫢

✨ SYNOPSIS ✨

#include <libdwarf.h>

int
dwarf_hasform(Dwarf_Attribute attr, Dwarf_Half form, Dwarf_Bool *ret,
    Dwarf_Error *err);

int
dwarf_whatform(Dwarf_Attribute attr, Dwarf_Half *retform,
    Dwarf_Error *err);

int
dwarf_whatform_direct(Dwarf_Attribute attr, Dwarf_Half *retform,
    Dwarf_Error *err);

πŸ’œ DESCRIPTION πŸ’œ

bestie, here's the tea on each function β˜•βœ¨

  • dwarf_hasform() β€” this one tells you whether the DWARF attribute passed as attr has the attribute form specified by form. If it does, the argument ret gets set to a non-zero value; if it doesn't, ret gets set to zero. If err is non-NULL, it'll be used to return an error descriptor in case of an error. πŸŽ€
  • dwarf_whatform() β€” this sets the location specified by retform to the attribute form code for the DWARF attribute referenced by attr. crucial detail: if the attribute referenced by attr has an indirect form attribute, this function returns the final form for the attribute. If err is non-NULL, it'll be used to return an error descriptor in case of an error. 🌈
  • dwarf_whatform_direct() β€” this also sets the location specified by retform to the attribute form code for the DWARF attribute referenced by attr. but if the form is an indirect form, it sets the location specified by retform to DW_FORM_indirect instead. If err is non-NULL, it'll be used to return an error descriptor in case of an error. πŸ’«

πŸ”₯ RETURN VALUES πŸ”₯

These functions return DW_DLV_OK on success. If something goes wrong, they return DW_DLV_ERR and set argument err. periodt. πŸ’…

πŸ“ ERRORS πŸ“

These functions may fail with the following errors:

  • [DW_DLE_ARGUMENT] β€” any of the arguments attr, ret, or retform was NULL. 😭

πŸ‘‘ SEE ALSO πŸ‘‘

go read dwarf(3), dwarf_attr(3), and dwarf_hasattr(3) too, iykyk πŸ’œ


mwah πŸ’‹ β€” source/version: Debian Β· date: May 22, 2010.

πŸ“¦ where this page comes from