DWARF_GET_ARANGE(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

✨ NAME ✨

dwarf_get_arange β€” retrieve the address range descriptor for an address.

okay so this is DWARF_GET_ARANGE(3), from the Library Functions Manual, and it is literally the page for finding which address range descriptor covers an address πŸ’–βœ¨

πŸ“š LIBRARY πŸ“š

DWARF Access Library (libdwarf, -ldwarf) β€” yes bestie, that's the one 🫢

πŸ› οΈ SYNOPSIS πŸ› οΈ

#include <libdwarf.h>

int
dwarf_get_arange(Dwarf_Arange *ar_list, Dwarf_Unsigned ar_cnt,
    Dwarf_Addr addr, Dwarf_Arange *ret_ar, Dwarf_Error *err);

πŸ’… DESCRIPTION πŸ’…

Function dwarf_get_arange() searches an array of Dwarf_Arange descriptors for one that covers a given address. main character behavior honestly πŸ‘‘

Argument ar_list should point to an array of Dwarf_Arange descriptors. It's giving β€œhere is the roster” energy.

Argument ar_cnt specifies the number of Dwarf_Arange descriptors in the array pointed to by argument ar_list. So yeah, count your entries bestie.

Argument addr specifies the address being looked up. The address in question, the one we're vibe-checking ✨

Argument ret_ar will be used to store the Dwarf_Arange descriptor that covers the given address. That's the winner that gets saved πŸŽ€

If argument err is not NULL, it will be used to store error information in case of an error. Very β€œif something goes wrong, write it down” of it.

🌈 RETURN VALUES 🌈

Function dwarf_get_arange() returns DW_DLV_OK when it succeeds. slay βœ…

It returns DW_DLV_NO_ENTRY if there is no Dwarf_Arange descriptor that covers the provided address. like, nothing matched, no cap 😭

In case of an error, it returns DW_DLV_ERROR and sets the argument err. so dramatic, but fair πŸ’€

🚨 ERRORS 🚨

Function dwarf_get_arange() can fail with:

  • [DW_DLE_ARGUMENT] β€” One of the arguments dbg, ar_list or ret_ar was NULL.
  • [DW_DLE_ARGUMENT] β€” Value of argument ar_cnt equals to 0.
  • [DW_DLE_NO_ENTRY] β€” A Dwarf_Arange descriptor that covers the given address was not found.
bestie, please note those two [DW_DLE_ARGUMENT] entries are both real and both listed β€” one for the NULL situation and one for ar_cnt being 0 🫢

πŸ‘€ SEE ALSO πŸ‘€


This page was brought to you by Debian, dated April 16, 2011 β€” mwah, enjoy the address-range hunt bestie πŸ˜˜πŸ’–

πŸ“¦ where this page comes from