DWARF_ADD_AT_NAME(3)
β¨ NAME β¨
okay so welcome to the DWARF_ADD_AT_NAME(3) page, bestie β this is one of those Library Functions Manual situations (libdwarf girlies rise π«Ά), and the function in question is dwarf_add_AT_name β it creates and attaches a DW_AT_name attribute π
π LIBRARY π
DWARF Access Library β and you link it with -ldwarf, no cap β¨
π¦ SYNOPSIS π¦
#include <libdwarf.h>
Dwarf_P_Attribute
dwarf_add_AT_name(Dwarf_P_Die die, char *name, Dwarf_Error *err);
πΈ DESCRIPTION πΈ
So here's the tea β: dwarf_add_AT_name() does two things in one iconic move β it creates a DW_AT_name attribute descriptor, and then attaches it to the debugging information entry that die points at. And the created attribute is gonna have DWARF form DW_FORM_strp. that's just how it is, periodt π
Quick vibe check on the args:
dieβ this one should reference a debugging information entry that was allocated usingdwarf_new_die(3). like, don't just make one up out of nowhere, bestie πnameβ should point to aNUL-terminated string, and that string becomes the value of the created attribute. that's literally the whole job πerrβ if it's notNULL, it gets used to store error information in case of an error. if it isNULL, well, she's not keeping receipts π
π RETURN VALUES π
On success β slay π
β dwarf_add_AT_name() returns the created attribute descriptor.
In case of an error, she returns DW_DLV_BADADDR and sets the argument err. so at least you'll know π
π₯ ERRORS π₯
Function dwarf_add_AT_name() can fail with:
[DW_DLE_ARGUMENT]β one of the argumentsdieornamewasNULL. yeah, that'll do it π[DW_DLE_MEMORY]β an out of memory condition was encountered during the execution of this function. lowkey the worst vibe π§οΈ
π SEE ALSO π
dwarf(3), dwarf_add_AT_comp_dir(3), dwarf_add_AT_const_value_string(3), dwarf_add_AT_producer(3), dwarf_add_AT_string(3), dwarf_new_die(3) β go read the whole friend group, iykyk β¨
and that's the page, bestie π«Ά this one's from Debian, dated September 4, 2011, and it's DWARF_ADD_AT_NAME(3) β mwah, go write some debug info πππΈ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: libdwarf 15.0.0
- Copyright (c) 2011 Kai Wang
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms