DWARF_HASATTR(3)
β¨ DWARF_HASATTR β¨
okay so bestie, this one's from the DWARF Access Library β that's libdwarf, and you link it with -ldwarf. it's your lil' bestie for poking at DWARF debug info, iykyk π§
πΈ NAME πΈ
dwarf_hasattr β the "does this DIE even have that attribute" check π
π LIBRARY π
DWARF Access Library (libdwarf, -ldwarf)
β SYNOPSIS β
#include <libdwarf.h>
int
dwarf_hasattr(Dwarf_Die die, Dwarf_Half attr, Dwarf_Bool *ret_bool,
Dwarf_Error *err);
π¦ DESCRIPTION π¦
so dwarf_hasattr() is literally the vibe check for attributes π₯ it tests whether the debugging information entry you referenced in argument die contains the attribute named by argument attr.
legal values for argument attr are the ones denoted by the DW_AT_* constants in the DWARF specification β no invented ones, bestie, we stay in spec β¨
if the named attribute is present in the debugging information entry, dwarf_hasattr() returns a non-zero value in the location pointed to by argument ret_bool π if the named attribute is not present, a zero gets written instead. either way you get a real answer, slay.
if argument err is not NULL, it will be used to return an error descriptor in case of an error. so like, pass it if you want the receipts π§Ύ
π RETURN VALUES π
on success, dwarf_hasattr() returns DW_DLV_OK β king behavior π
in case of an error, it returns DW_DLV_ERROR and sets argument err. π
π ERRORS π
dwarf_hasattr() can fail with exactly this one error:
[DW_DLE_ARGUMENT]β either of argumentdieorret_boolwasNULL. yeah, passingNULLis not the move, bestie π
ngl, that NULL check is the whole error list β no secret extra failures hiding in here, fr fr.
π SEE ALSO π
and that's the whole page, no cap π«Ά this cutie came from Debian, dated April 17, 2010 β yeah she's an elder Gen Z, respect the icon πβ¨π
π¦ 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) 2010 Kai Wang
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms