---
name: "dwarf_add_AT_const_value_signedint"
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_const_value_signedint"
---

# dwarf\_add\_AT\_const\_value\_signedint(3)

create and attach a DW\_AT\_const\_value attribute

## NAME

**dwarf\_add\_AT\_const\_value\_signedint**, **dwarf\_add\_AT\_const\_value\_string**, **dwarf\_add\_AT\_const\_value\_unsignedint** – create and attach a DW\_AT\_const\_value attribute

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*Dwarf\_P\_Attribute*\

**dwarf\_add\_AT\_const\_value\_signedint**(*Dwarf\_P\_Die die*, *Dwarf\_Signed value*, *Dwarf\_Error \*err*);

*Dwarf\_P\_Attribute*\

**dwarf\_add\_AT\_const\_value\_string**(*Dwarf\_P\_Die die*, *char \*str*, *Dwarf\_Error \*err*);

*Dwarf\_P\_Attribute*\

**dwarf\_add\_AT\_const\_value\_unsignedint**(*Dwarf\_P\_Die die*, *Dwarf\_Unsigned value*, *Dwarf\_Error \*err*);

## DESCRIPTION

These functions create a DW\_AT\_const\_value attribute descriptor and attach it to the debugging information entry referenced by argument *die*.

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

Function **dwarf\_add\_AT\_const\_value\_signedint**() creates a DW\_AT\_const\_value attribute descriptor containing the signed value specified by argument *value*. The created attribute descriptor will have DWARF form DW\_FORM\_sdata.

Function **dwarf\_add\_AT\_const\_value\_unsignedint**() creates a DW\_AT\_const\_value attribute descriptor containing the unsigned value specified by argument *value*. The created attribute descriptor will have DWARF form DW\_FORM\_udata.

Function **dwarf\_add\_AT\_const\_value\_string**() creates a DW\_AT\_const\_value attribute descriptor containing the string pointed to by the NUL-terminated argument *str*. The created attribute descriptor will have DWARF form DW\_FORM\_strp.

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

## RETURN VALUES

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

## ERRORS

These functions can fail with:

- \[DW\_DLE\_ARGUMENT\]

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

- \[DW\_DLE\_MEMORY\]

  An out of memory condition was encountered during execution.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_add\_AT\_name(3)](/dwarf_add_AT_name/3.md), [dwarf\_add\_AT\_signed\_const(3)](/dwarf_add_AT_signed_const/3.md), [dwarf\_add\_AT\_string(3)](/dwarf_add_AT_string/3.md), [dwarf\_add\_AT\_unsigned\_const(3)](/dwarf_add_AT_unsigned_const/3.md), [dwarf\_new\_die(3)](/dwarf_new_die/3.md)
