DWARF_GET_ADDRESS_SIZE(3)
β¨ DWARF_GET_ADDRESS_SIZE π
okay bestie, so this one lives in the DWARF Access Library (that's libdwarf, and you link it with -ldwarf π). It's a tiny little function but it's literally doing the most important thing: telling you how many bytes an address takes up. icon behavior, no cap.
πΈ SYNOPSIS πΈ
#include <libdwarf.h>
int
dwarf_get_address_size(Dwarf_Debug dbg, Dwarf_Half *addr_size,
Dwarf_Error *err);
π DESCRIPTION π
okay so dwarf_get_address_size() returns the size in bytes of a native address for a program object. that's it, that's the whole vibe. β¨
dbgβ this should denote a DWARF debug context that you created from a program object usingdwarf_init(3). main character argument fr.addr_sizeβ point this at a location that will hold the returned size. like, give it somewhere to live π«Άerrβ if it's non-NULL, it gets used to return error information. if you pass NULL, that's your choice bestie π
π¦ RETURN VALUES π¦
On success, function dwarf_tag() returns DW_DLV_OK π (yes, the manpage really does say dwarf_tag() here β i'm not fixing it, i'm just reporting it, iykyk π).
In case of an error, it returns DW_DLV_ERROR and sets argument err. sad girl hours π
π₯ ERRORS π₯
Function dwarf_get_address_size() can fail with the following error:
[DW_DLE_ARGUMENT]β either of argumentsdbgoraddr_sizewasNULL. so like... actually pass them, bestie π
π SEE ALSO π
dwarf(3), dwarf_finish(3), dwarf_init(3)
ngl this page is short and sweet and i'm obsessed with it. go read the friends it's referencing, they're the whole ecosystem. periodt. β
Debian, April 14, 2010 β that's the source/version and date, mwah, signing off π§π
π¦ 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