DWARF_ADD_PUBNAME(3)

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

πŸ’… 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 arguments dbg, die or name was NULL. 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