DWARF_ADD_AT_LOCATION_EXPR(3)

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

🌸 NAME β€” dwarf_add_AT_location_expr 🌸

Hii bestie, welcome to the DWARF Access Library manual, section 3 β€” the libdwarf / -ldwarf one. This page is literally about dwarf_add_AT_location_expr β€” it creates an attribute descriptor for a location expression. Slay. πŸ’…


πŸ“š LIBRARY πŸ“š

DWARF Access Library (libdwarf, -ldwarf).


✨ SYNOPSIS ✨

#include <libdwarf.h>

Dwarf_P_Attribute
dwarf_add_AT_location_expr(Dwarf_P_Debug dbg, Dwarf_P_Die die,
    Dwarf_Half attr, Dwarf_P_Expr loc_expr, Dwarf_Error *err);

πŸ’– DESCRIPTION πŸ’–

Okay so dwarf_add_AT_location_expr() creates an attribute descriptor for a location expression and attaches it to the debugging information entry referenced by argument die. Iconic behavior, no cap.

Here's the vibe check on the arguments:

The attribute created by dwarf_add_AT_location_expr() will have one of the DWARF forms DW_FORM_block, DW_FORM_block1, DW_FORM_block2 or DW_FORM_block4, depending on the size of the byte stream generated by the location expression descriptor referenced by argument loc_expr. It's giving "form chosen by byte-stream size realness" πŸ’«

If argument err is not NULL, it will be used to store error information in case of an error. 🫢


πŸ¦‹ RETURN VALUES πŸ¦‹

On success, dwarf_add_AT_location_expr() returns the created attribute descriptor. Bestie ate and left no crumbs. πŸ’…

In case of an error, dwarf_add_AT_location_expr() returns DW_DLV_BADADDR and sets the argument err. 😭


πŸŽ€ ERRORS πŸŽ€

dwarf_add_AT_location_expr() can fail with:

  • [DW_DLE_ARGUMENT] β€” one of the arguments dbg, die or loc_expr was NULL.
  • [DW_DLE_MEMORY] β€” an out of memory condition was encountered during the execution of the function.

🌈 SEE ALSO 🌈

dwarf(3), dwarf_new_die(3), dwarf_new_expr(3), dwarf_producer_init(3), dwarf_producer_init_b(3)


K bye bestie πŸ’– β€” this little manual-page moment came from Debian, dated September 5, 2011, and its whole handle is DWARF_ADD_AT_LOCATION_EXPR(3). πŸŽ€

πŸ“¦ where this page comes from