---
name: "dwarf_get_arange_cu_header_offset"
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_cu_header_offset"
---

# dwarf\_get\_arange\_cu\_header\_offset(3)

retrieve compilation unit offsets

## NAME

**dwarf\_get\_arange\_cu\_header\_offset**, **dwarf\_get\_cu\_die\_offset** – retrieve compilation unit offsets

## LIBRARY

library “libdwarf”

## SYNOPSIS

**#include \<libdwarf.h\>**

*int*\

**dwarf\_get\_arange\_cu\_header\_offset**(*Dwarf\_Arange ar*, *Dwarf\_Off \*ret*, *Dwarf\_Error \*err*);

*int*\

**dwarf\_get\_cu\_die\_offset**(*Dwarf\_Arange ar*, *Dwarf\_Off \*ret*, *Dwarf\_Error \*err*);

## DESCRIPTION

These functions retrieve the offsets, relative to the “.debug\_info” DWARF section, of the debugging information entries describing the compilation unit associated with a *Dwarf\_Arange* descriptor.

Function **dwarf\_get\_arange\_cu\_header\_offset**() retrieves the offset of the compilation unit header associated with argument *ar*, and stores it in the location pointed to by argument *ret*.

Function **dwarf\_get\_cu\_die\_offset**() retrieves the offset of the debugging information entry for the compilation unit associated with argument *ar*, and stores it in the location pointed to by argument *ret*.

If argument *err* is not NULL, these functions will use it to store error information, in case of an error.

## RETURN VALUES

On success, these functions returns DW\_DLV\_OK. In case of an error, they return DW\_DLV\_ERROR and set the argument *err*.

## ERRORS

These functions may fail with:

- \[DW\_DLE\_ARGUMENT\]

  Argument *ar* was not a valid *Dwarf\_Arange* descriptor.

- \[DW\_DLE\_ARGUMENT\]

  Argument *ret* was NULL.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_get\_arange(3)](/dwarf_get_arange/3.md), [dwarf\_get\_arange\_info(3)](/dwarf_get_arange_info/3.md), [dwarf\_get\_aranges(3)](/dwarf_get_aranges/3.md)
