DWARF_ADD_PUBNAME(3)
π DWARF_ADD_PUBNAME(3) π
okay so this is a section 3 manual page from the DWARF Access Library β yes bestie, libdwarf, page three, we're in function territory π«Ά
β¨ NAME β¨
dwarf_add_pubname β the glow-up move where you add info about a global object to a DWARF producer instance π
π LIBRARY π
DWARF Access Library (libdwarf, link it with -ldwarf) β no cap, that's the one π
π§ SYNOPSIS π§
#include <libdwarf.h>
Dwarf_Unsigned
dwarf_add_pubname(Dwarf_P_Debug dbg, Dwarf_P_Die die, char *name,
Dwarf_Error *err);
π DESCRIPTION π
So dwarf_add_pubname() literally adds information about a global object to a DWARF producer instance. That's the whole vibe. Iconic, honestly β¨
The argument dbg should reference a DWARF producer instance β and it has to be one you allocated using dwarf_producer_init(3) or dwarf_producer_init_b(3). Don't be out here passing random stuff, iykyk π
The argument die specifies the debugging information entry that's associated with the global object. Like, the DIE, bestie. The main character π
The argument name should point to a NUL-terminated string containing the name of the global object β NUL-terminated, okay? Not optional, that's the rule π
And if the argument err is not NULL, it will be used to store error information in case of an error. Free little error bucket, lowkey useful π«Ά
π₯ RETURN VALUES π₯
On success, dwarf_add_pubname() returns a non-zero value. Slay π
In case of an error, dwarf_add_pubname() returns 0 and sets the argument err. So like, if you get a 0, that's your cue to go check err instead of spiraling π
π ERRORS π
Function dwarf_add_pubname() can fail with:
[DW_DLE_ARGUMENT]β one of the argumentsdbg,dieornamewasNULL. Three chances to fumble, and it WILL tell you π[DW_DLE_MEMORY]β an out of memory condition was encountered during the execution of the function. Not the vibe, but it happens π
π SEE ALSO π
dwarf(3), dwarf_add_funcname(3), dwarf_add_typename(3), dwarf_add_varname(3), dwarf_add_weakname(3), dwarf_new_die(3), dwarf_producer_init(3), dwarf_producer_init_b(3)
ok that's the whole page, go forth and name your globals π β¨
Debian π September 24, 2011 π DWARF_ADD_PUBNAME(3) β that's the source, version and date, mwah, bye bestie ππ§πΈ
π¦ 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