---
name: "dwarf_get_form_class"
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_form_class"
---

# dwarf\_get\_form\_class(3)

retrieve the form class of an attribute

## NAME

**dwarf\_get\_form\_class** – retrieve the form class of an attribute

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*enum* *Dwarf\_Form\_Class*\

**dwarf\_get\_form\_class**(*Dwarf\_Half dwversion*, *Dwarf\_Half attr*, *Dwarf\_Half offset\_size*, *Dwarf\_Half form*);

## DESCRIPTION

Function **dwarf\_get\_form\_class**() returns the class of the form of a DWARF attribute.

Argument *dwversion* should specify the version number of DWARF specification to use: 2 for DWARF2, 3 for DWARF3 and 4 for DWARF4.

Argument *attr* should hold the attribute code of the attribute, i.e., one of the DW\_AT\_\* values defined in ⟨libdwarf.h⟩.

Argument *offset\_size* should hold the size of a DWARF offset for the relevant compilation unit.

Argument *form* should hold the form code of the attribute.

## RETURN VALUES

On success, function **dwarf\_get\_form\_class**() returns the form class code, which is one of the DW\_FORM\_CLASS\_\* contants defined in header file ⟨libdwarf.h⟩. If the function was not able to determine the form class of the attribute, it returns the special form class code DW\_FORM\_CLASS\_UNKNOWN.

## ERRORS

Function **dwarf\_get\_form\_class**() does not return an error.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_attr(3)](/dwarf_attr/3.md), [dwarf\_whatattr(3)](/dwarf_whatattr/3.md), [dwarf\_whatform(3)](/dwarf_whatform/3.md)
