DWARF_GET_ARANGE_INFO(3)
π DWARF_GET_ARANGE_INFO(3) π
okay bestie, welcome to the DWARF_GET_ARANGE_INFO(3) page from the Library Functions Manual β yes, that's the manual name folded in like a cute little crown π. This one is all about pulling address range info out of a descriptor, and it's lowkey iconic.
πΈ NAME πΈ
dwarf_get_arange_info β extract address range information from a descriptor β¨
π¦ LIBRARY π¦
DWARF Access Library (libdwarf, -ldwarf) π
π SYNOPSIS π
#include <libdwarf.h>
int
dwarf_get_arange_info(Dwarf_Arange ar, Dwarf_Addr *start,
Dwarf_Unsigned *length, Dwarf_Off *cu_die_offset, Dwarf_Error *err);
β¨ DESCRIPTION β¨
okay so dwarf_get_arange_info() is the function that extracts address range information from a Dwarf_Arange descriptor. slay.
arβ should reference a validDwarf_Arangedescriptor returned by functiondwarf_get_aranges(3).startβ should point to a location which will hold the start value of the address range associated with the descriptor.lengthβ should point to a location which will hold the length in bytes of the address range associated with the descriptor.cu_die_offsetβ should point to a location which will be set to an offset, relative to the.debug_infosection, of the first debugging information entry in the compilation unit associated with argumentar.errβ if this argument is notNULL, it will be used to store error information in case of an error.
π RETURN VALUES π
Function dwarf_get_arange_info() returns DW_DLV_OK when it succeeds. In case of an error, it returns DW_DLV_ERROR and sets the argument err.
π EXAMPLES π
To loop through all the address lookup table entries, use:
Dwarf_Debug dbg;
Dwarf_Addr start;
Dwarf_Arange *aranges;
Dwarf_Off die_off;
Dwarf_Signed i, cnt;
Dwarf_Unsigned length;
Dwarf_Error de;
if (dwarf_get_aranges(dbg, &aranges, &cnt, &de) != DW_DLV_OK)
errx(EXIT_FAILURE, "dwarf_get_aranges: %s",
dwarf_errmsg(de));
for (i = 0; i < cnt; i++) {
if (dwarf_get_arange_info(aranges[i], &start, &length,
&die_off, &de) != DW_DLV_OK) {
warnx("dwarf_get_arange_info: %s",
dwarf_errmsg(de));
continue;
}
/* Do something with the returned information. */
}
π ERRORS π
Function dwarf_get_arange_info() can fail with:
[DW_DLE_ARGUMENT]β one of the argumentsar,start,lengthorcu_die_offsetwasNULL.
π«Ά SEE ALSO π«Ά
dwarf(3)dwarf_get_arange(3)dwarf_get_arange_cu_header_offset(3)dwarf_get_aranges(3)dwarf_get_cu_die_offset(3)
π source/version: Debian Β· date: April 16, 2011 β that's the cute sign-off, bestie, byeee π«Άβ¨
π¦ 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