---
name: "dwarf_get_arange"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/dwarf_get_arange"
---

# dwarf\_get\_arange(3)

retrieve the address range descriptor for an address

## NAME

**dwarf\_get\_arange** – retrieve the address range descriptor for an address

## LIBRARY

library “libdwarf”

## 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.

Argument *ar\_list* should point to an array of *Dwarf\_Arange* descriptors.

Argument *ar\_cnt* specifies the number of *Dwarf\_Arange* descriptors in the array pointed to by argument *ar\_list*.

Argument *addr* specifies the address being looked up.

Argument *ret\_ar* will be used to store the *Dwarf\_Arange* descriptor that covers the given address.

If argument *err* is not NULL, it will be used to store error information in case of an error.

## RETURN VALUES

Function **dwarf\_get\_arange**() returns DW\_DLV\_OK when it succeeds. It returns DW\_DLV\_NO\_ENTRY if there is no *Dwarf\_Arange* descriptor that covers the provided address. In case of an error, it returns DW\_DLV\_ERROR and sets the argument *err*.

## 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.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_get\_arange\_cu\_header\_offset(3)](/dwarf_get_arange_cu_header_offset/3.md), [dwarf\_get\_arange\_info(3)](/dwarf_get_arange_info/3.md), [dwarf\_get\_aranges(3)](/dwarf_get_aranges/3.md), [dwarf\_get\_cu\_die\_offset(3)](/dwarf_get_cu_die_offset/3.md)
