---
name: "dwarf_tag"
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_tag"
---

# dwarf\_tag(3)

retrieve the tag associated with a DWARF debugging information entry

## NAME

**dwarf\_tag** – retrieve the tag associated with a DWARF debugging information entry

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*int*\

**dwarf\_tag**(*Dwarf\_Die die*, *Dwarf\_Half \*tag*, *Dwarf\_Error \*err*);

## DESCRIPTION

Function **dwarf\_tag**() retrieves the tag associated with the debugging information entry referenced by argument *die*, and stores it into the location pointed to by argument *tag*.

If argument *err* if non-NULL, it will be used to return an error descriptor in case of an error.

## 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\_tag**() can fail with the following error:

- \[DW\_DLE\_ARGUMENT\]

  Argument *die* or *tag* was NULL.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_die\_abbrev\_code(3)](/dwarf_die_abbrev_code/3.md), [dwarf\_diename(3)](/dwarf_diename/3.md), [dwarf\_dieoffset(3)](/dwarf_dieoffset/3.md)
