---
name: "dwarf_add_AT_targ_address_b"
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_add_AT_targ_address"
---

# dwarf\_add\_AT\_targ\_address\_b(3)

create and attach address class attributes

Part of [dwarf\_add\_AT\_targ\_address(3)](/dwarf_add_AT_targ_address/3.md).

## NAME

**dwarf\_add\_AT\_targ\_address**, **dwarf\_add\_AT\_targ\_address\_b** – create and attach address class attributes

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*Dwarf\_P\_Attribute*\

**dwarf\_add\_AT\_targ\_address**(*Dwarf\_P\_Debug dbg*, *Dwarf\_P\_Die die*, *Dwarf\_Half attr*, *Dwarf\_Unsigned pc\_value*, *Dwarf\_Signed sym\_index*, *Dwarf\_Error \*err*);

*Dwarf\_P\_Attribute*\

**dwarf\_add\_AT\_targ\_address\_b**(*Dwarf\_P\_Debug dbg*, *Dwarf\_P\_Die die*, *Dwarf\_Half attr*, *Dwarf\_Unsigned pc\_value*, *Dwarf\_Unsigned sym\_index*, *Dwarf\_Error \*err*);

## DESCRIPTION

Function **dwarf\_add\_AT\_targ\_address\_b**() creates an attribute descriptor belonging to the ‘address’ class and attaches it to the debugging information entry referenced by argument *die*.

The created attribute descriptor will have DWARF form DW\_FORM\_addr. If flag DW\_DLC\_SIZE\_64 is set on the producer instance, the attribute value will be 8 bytes in size. Otherwise the attribute value will be 4 bytes in size.

Argument *dbg* should reference a DWARF producer instance allocated using [dwarf\_producer\_init(3)](/dwarf_producer_init/3.md) or [dwarf\_producer\_init\_b(3)](/dwarf_producer_init_b/3.md).

Argument *die* should reference a debugging information entry allocated using [dwarf\_new\_die(3)](/dwarf_new_die/3.md).

Argument *attr* should specify the attribute code of the created attribute descriptor.

Argument *pc\_value* should hold a relocatable address value which will become the value of the created attribute descriptor.

Argument *sym\_index* should specify the ELF symbol index of the symbol to be used for relocating the address value.

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

Function **dwarf\_add\_AT\_targ\_address**() is deprecated. It is similar to function **dwarf\_add\_AT\_targ\_address\_b**() except that it cannot handle all possible symbol index values.

## RETURN VALUES

On success, these functions return the created attribute descriptor. In case of an error, these functions return DW\_DLV\_BADADDR and sets the argument *err*.

## ERRORS

These functions can fail with:

- \[DW\_DLE\_ARGUMENT\]

  Either of the arguments *dbg* or *die* was NULL.

- \[DW\_DLE\_MEMORY\]

  An out of memory condition was encountered during execution.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_add\_AT\_const\_value\_unsignedint(3)](/dwarf_add_AT_const_value_unsignedint/3.md), [dwarf\_add\_AT\_dataref(3)](/dwarf_add_AT_dataref/3.md), [dwarf\_add\_AT\_ref\_address(3)](/dwarf_add_AT_ref_address/3.md), [dwarf\_add\_AT\_signed\_const(3)](/dwarf_add_AT_signed_const/3.md), [dwarf\_add\_AT\_unsigned\_const(3)](/dwarf_add_AT_unsigned_const/3.md), [dwarf\_new\_die(3)](/dwarf_new_die/3.md), [dwarf\_producer\_init(3)](/dwarf_producer_init/3.md), [dwarf\_producer\_init\_b(3)](/dwarf_producer_init_b/3.md)
