DWARF_HIGHPC(3)
π DWARF_HIGHPC β the attribute-getter squad π
okay so bestie, this is DWARF_HIGHPC from the Library Functions Manual, section 3 β manual name folded in right at the top because we are not copy-pasting the boring header line, we are serving it π
β¨ NAME β¨
the whole squad is dwarf_arrayorder, dwarf_bitoffset, dwarf_bitsize, dwarf_bytesize, dwarf_highpc, dwarf_highpc_b, dwarf_lowpc, dwarf_srclang β and their whole job is to retrieve the value of a DWARF attribute. iconic, honestly π«Ά
π LIBRARY π
DWARF Access Library (libdwarf, -ldwarf) β that's the library vibe, no cap.
π¦ SYNOPSIS π¦
#include <libdwarf.h>
int
dwarf_arrayorder(Dwarf_Die die, Dwarf_Unsigned *ret_order,
Dwarf_Error *err);
int
dwarf_bitoffset(Dwarf_Die die, Dwarf_Unsigned *ret_size,
Dwarf_Error *err);
int
dwarf_bitsize(Dwarf_Die die, Dwarf_Unsigned *ret_size,
Dwarf_Error *err);
int
dwarf_bytesize(Dwarf_Die die, Dwarf_Unsigned *ret_size,
Dwarf_Error *err);
int
dwarf_highpc(Dwarf_Die die, Dwarf_Addr *ret_highpc, Dwarf_Error *err);
int
dwarf_highpc_b(Dwarf_Die die, Dwarf_Addr *ret_highpc,
Dwarf_Half *ret_form, enum Dwarf_Form_Class *ret_class,
Dwarf_Error *err);
int
dwarf_lowpc(Dwarf_Die die, Dwarf_Addr *ret_lowpc, Dwarf_Error *err);
int
dwarf_srclang(Dwarf_Die die, Dwarf_Unsigned *ret_lang,
Dwarf_Error *err);
πΈ DESCRIPTION πΈ
these convenience functions are used to retrieve DWARF attribute values associated with a Debugging Information Entry (DIE) descriptor denoted by argument die. they store the value of the requested attribute into the location pointed to by their second argument, provided that the requested attribute exists in the debugging information entry. literally that's the whole bit π
here's the function-to-attribute cheat sheet, bestie:
dwarf_arrayorder()β retrieve theDW_AT_orderingattribute value.dwarf_bitoffset()β retrieve theDW_AT_bit_offsetattribute value.dwarf_bitsize()β retrieve theDW_AT_bit_sizeattribute value.dwarf_bytesize()β retrieve theDW_AT_byte_sizeattribute value.dwarf_highpc()β retrieve theDW_AT_high_pcattribute value.dwarf_highpc_b()β retrieve theDW_AT_high_pcattribute value.dwarf_lowpc()β retrieve theDW_AT_low_pcattribute value.dwarf_srclang()β retrieve theDW_AT_languageattribute value.
function dwarf_highpc_b() is an enhanced version of function dwarf_highpc(). it sets the location specified by argument ret_form to the form code of the attribute DW_AT_high_pc, and sets the location specified by argument ret_class to the class of that form. a value of NULL may be used for either of the arguments ret_form or ret_class if the caller is not interested in the respective value. thoughtful queen behavior π
β RETURN VALUES β
these functions return DW_DLV_OK on success. slay.
if the debugging information entry descriptor denoted by argument die does not contain the requested attribute, these functions return DW_DLV_NO_ENTRY and set argument err. for other errors, they return DW_DLV_ERROR and set argument err. keep that error pointer close, bestie π
π ERRORS π
these functions can fail with the following errors:
[DW_DLE_ARGUMENT]β argumentsdie,ret_highpc,ret_lowpc,ret_size,ret_langorret_orderwereNULL.[DW_DLE_NO_ENTRY]β argumentdiehad no requested attribute.
π§ SEE ALSO π§
dwarf(3), dwarf_attr(3), dwarf_attrlist(3), dwarf_get_form_class(3), dwarf_hasattr(3) β go read the whole friend group, iykyk π¦
mwah π this page is from Debian, dated July 22, 2014 β source/version and date sign-off delivered, periodt πβ¨
π¦ 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,2014 Kai Wang
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms