DWARF_ADD_AT_CONST_VALUE_UNSIGNEDINT(3)

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

DWARF_ADD_AT_CONST_VALUE(3) 🧚✨

okay so this page is from the Library Functions Manual and it's serving DWARF Access Library realness β€” that's libdwarf, linked with -ldwarf. It's about three functions that create and attach a DW_AT_const_value attribute, and honestly? iconic. πŸ’…

✨ NAME ✨

  • dwarf_add_AT_const_value_signedint
  • dwarf_add_AT_const_value_string
  • dwarf_add_AT_const_value_unsignedint

β€” all three create and attach a DW_AT_const_value attribute. periodt.

πŸ“š LIBRARY πŸ“š

DWARF Access Library (libdwarf, -ldwarf) 🫢

πŸ› οΈ SYNOPSIS πŸ› οΈ

#include <libdwarf.h>

Dwarf_P_Attribute
dwarf_add_AT_const_value_signedint(Dwarf_P_Die die, Dwarf_Signed value,
    Dwarf_Error *err);

Dwarf_P_Attribute
dwarf_add_AT_const_value_string(Dwarf_P_Die die, char *str,
    Dwarf_Error *err);

Dwarf_P_Attribute
dwarf_add_AT_const_value_unsignedint(Dwarf_P_Die die,
    Dwarf_Unsigned value, Dwarf_Error *err);

🌸 DESCRIPTION 🌸

These functions create a DW_AT_const_value attribute descriptor and attach it to the debugging information entry referenced by argument die.

Argument die should reference a debugging information entry allocated using dwarf_new_die(3). Yes bestie, allocate first, then attach β€” main character energy only.

Here's the sibling breakdown:

  • dwarf_add_AT_const_value_signedint() β€” creates a DW_AT_const_value attribute descriptor containing the signed value specified by argument value. The created attribute descriptor will have DWARF form DW_FORM_sdata. πŸŽ€
  • dwarf_add_AT_const_value_unsignedint() β€” creates a DW_AT_const_value attribute descriptor containing the unsigned value specified by argument value. The created attribute descriptor will have DWARF form DW_FORM_udata. πŸ”₯
  • dwarf_add_AT_const_value_string() β€” creates a DW_AT_const_value attribute descriptor containing the string pointed to by the NUL-terminated argument str. The created attribute descriptor will have DWARF form DW_FORM_strp. πŸ¦‹

If argument err is not NULL, it will be used by these functions to store error information in case of an error. So like, pass it if you want the tea on what went wrong. β˜•

🫢 RETURN VALUES 🫢

On success, these functions return the created attribute descriptor. In case of an error, these functions return DW_DLV_BADADDR and set the argument err. no cap, that's the whole vibe.

πŸ’€ ERRORS πŸ’€

These functions can fail with:

  • [DW_DLE_ARGUMENT] β€” Either of the arguments die or str was NULL.
  • [DW_DLE_MEMORY] β€” An out of memory condition was encountered during execution.

πŸ‘€ SEE ALSO πŸ‘€


sign-off time 🌈 this page is from Debian, dated September 4, 2… (the original footer literally cuts off mid-year, bestie 😭), and the footer name is DWARF_ADD_AT_CONST_VALUE_STRING(3). go off and attach those attributes, queen πŸ‘‘πŸ’–

πŸ“¦ where this page comes from