dwarf_get_address_size(3)

dwarf_get_address_size3

Return the number of bytes needed to represent an address

Usage

#include <libdwarf.h>

int

dwarf_get_address_size(Dwarf_Debug dbg, Dwarf_Half *addr_size, Dwarf_Error *err);

Library

library “libdwarf”

Overview

Function dwarf_get_address_size() returns the size in bytes of a native address for a program object.

Argument dbg should denote a DWARF debug context created from a program object using dwarf_init(3). Argument addr_size should point to a location that will hold the returned size. Argument err, if non-NULL, it will be used to return error information.

Return values

On success, function dwarf_tag() returns DW_DLV_OK. In case of an error, it returns DW_DLV_ERROR and sets argument err.

Errors

Function dwarf_get_address_size() can fail with the following error:

[DW_DLE_ARGUMENT]

Either of arguments dbg or addr_size was NULL.

Releases

25 releases since FreeBSD 11.0-RELEASE; the text changed 1 time.

  1. 11.0–12.0
  2. 12.1–16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.