DWARF_ADD_AT_TARG_ADDRESS(3)
π DWARF_ADD_AT_TARG_ADDRESS(3) β the manual page, bestie edition
okay so you're in the Library Functions Manual for DWARF_ADD_AT_TARG_ADDRESS(3) and honestly? you're about to learn how to make address-class attributes and it's gonna slay β¨
π NAME π
dwarf_add_AT_targ_address, dwarf_add_AT_targ_address_b β create and attach address class attributes π
πΈ LIBRARY πΈ
DWARF Access Library (libdwarf, -ldwarf)
π¦ SYNOPSIS π¦
#include <libdwarf.h>
Dwarf_P_Attribute
dwarf_add_AT_targ_address(Dwarf_P_Debug dbg, Dwarf_P_Die die,
Dwarf_Half attr, Dwarf_Unsigned pc_value, Dwarf_Signed sym_index,
Dwarf_Error *err);
Dwarf_P_Attribute
dwarf_add_AT_targ_address_b(Dwarf_P_Debug dbg, Dwarf_P_Die die,
Dwarf_Half attr, Dwarf_Unsigned pc_value, Dwarf_Unsigned sym_index,
Dwarf_Error *err);
β¨ DESCRIPTION β¨
so dwarf_add_AT_targ_address_b() is the main character here: it creates an attribute descriptor that belongs to the βaddressβ class and attaches it to the debugging information entry that argument die points at. it's giving "I make attributes and I make them address-class" π
the created attribute descriptor will have DWARF form DW_FORM_addr. and here's the tea: if flag DW_DLC_SIZE_64 is set on the producer instance, the attribute value will be 8 bytes in size. otherwise? the attribute value will be 4 bytes in size. no cap, that's just how it is β¨
- argument dbg β should reference a DWARF producer instance allocated using
dwarf_producer_init(3)ordwarf_producer_init_b(3). like, that's the vibe it needs to have already π«Ά - argument die β should reference a debugging information entry allocated using
dwarf_new_die(3)π - argument attr β should specify the attribute code of the created attribute descriptor πΈ
- argument pc_value β should hold a relocatable address value which will become the value of the created attribute descriptor π¦
- argument sym_index β should specify the ELF symbol index of the symbol to be used for relocating the address value π
- argument err β if it's not
NULL, it will be used to store error information in case of an error. like a little error-holding bag π
π¨ important bestie moment: functiondwarf_add_AT_targ_address()is deprecated. it's similar todwarf_add_AT_targ_address_b()except that it cannot handle all possible symbol index values. so likeβ¦ use the_bone, she ate π
π₯ RETURN VALUES π₯
on success, these functions return the created attribute descriptor π in case of an error, these functions return DW_DLV_BADADDR and sets the argument err. yeah, the bad-address one, you know the one π
π ERRORS π
these functions can fail with:
[DW_DLE_ARGUMENT]β either of the arguments dbg or die wasNULL. like bestie, those gotta be actual things, not nothing π[DW_DLE_MEMORY]β an out of memory condition was encountered during execution. ran out of RAM mid-slaying, tragic π
π SEE ALSO π
dwarf(3), dwarf_add_AT_const_value_unsignedint(3), dwarf_add_AT_dataref(3), dwarf_add_AT_ref_address(3), dwarf_add_AT_signed_const(3), dwarf_add_AT_unsigned_const(3), dwarf_new_die(3), dwarf_producer_init(3), dwarf_producer_init_b(3)
go read the whole friend group, they're all iconic β
and that's the page!! this one's brought to you by Debian, dated September 4, 2011, and it lives under the handle DWARF_ADD_AT_TARG_ADDRESS(3) β mwah, go build some address attributes 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