---
name: "dwarf_add_frame_fde_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_frame_fde"
---

# dwarf\_add\_frame\_fde\_b(3)

add a call frame descriptor to a DWARF producer instance

Part of [dwarf\_add\_frame\_fde(3)](/dwarf_add_frame_fde/3.md).

## NAME

**dwarf\_add\_frame\_fde** – add a call frame descriptor to a DWARF producer instance

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*Dwarf\_Unsigned*\

**dwarf\_add\_frame\_fde**(*Dwarf\_P\_Debug dbg*, *Dwarf\_P\_Fde fde*, *Dwarf\_P\_Die die*, *Dwarf\_Unsigned cie*, *Dwarf\_Addr virt\_addr*, *Dwarf\_Unsigned code\_len*, *Dwarf\_Unsigned symbol\_index*, *Dwarf\_Error \*err*);

*Dwarf\_Unsigned*\

**dwarf\_add\_frame\_fde\_b**(*Dwarf\_P\_Debug dbg*, *Dwarf\_P\_Fde fde*, *Dwarf\_P\_Die die*, *Dwarf\_Unsigned cie*, *Dwarf\_Addr virt\_addr*, *Dwarf\_Unsigned code\_len*, *Dwarf\_Unsigned symbol\_index*, *Dwarf\_Unsigned end\_symbol\_index*, *Dwarf\_Addr offset\_from\_end\_sym*, *Dwarf\_Error \*err*);

## DESCRIPTION

Function **dwarf\_add\_frame\_fde\_b**() adds the call frame descriptor referenced by argument *fde* to a producer instance.

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 *fde* should reference a frame descriptor allocated using [dwarf\_new\_fde(3)](/dwarf_new_fde/3.md).

Argument *die* is ignored by this implementation of the library “libdwarf”.

Argument *cie* specifies the index of call frame common information entry for the frame descriptor. Valid indices are those returned by the function [dwarf\_add\_frame\_cie(3)](/dwarf_add_frame_cie/3.md).

Argument *symbol\_index* specifies the ELF symbol index of the first symbol to be used for relocation.

The meaning of the arguments *virt\_addr*, *code\_len* and *offset\_from\_end\_sym* depend on the value of argument *end\_symbol\_index*:

- If the argument *end\_symbol\_index* is zero, the argument *virt\_addr* specifies the relocatable address of the start of the function associated with the frame descriptor, the argument *code\_len* specifies the size in bytes of the machine instructions for this function, the argument *symbol\_index* specifies the ELF symbol to be used for relocating the address in argument *virt\_addr*, and the argument *offset\_from\_end\_symbol* is ignored.

- If the argument *end\_symbol\_index* is non-zero, it specifies the ELF symbol index of the second symbol to be used for relocation. In this case, the argument *virt\_addr* specifies an offset from the relocatable symbol specified by argument *symbol\_index*, the argument *offset\_from\_end\_symbol* should specify an offset from the symbol named by the argument *end\_symbol\_index*, and the argument *code\_len* will be ignored. The DW\_DLC\_SYMBOLIC\_RELOCATIONS flag should also have been set on the DWARF producer instance.

  Application code can retrieve the relocation entries for the symbol pair by calling function [dwarf\_get\_relocation\_info(3)](/dwarf_get_relocation_info/3.md). The relocation entry for the first symbol will have type dwarf\_drt\_first\_of\_length\_pair and the relocation entry for the second symbol will have type dwarf\_drt\_second\_of\_length\_pair.

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

Function **dwarf\_add\_frame\_fde**() is similar to function **dwarf\_add\_frame\_fde\_b**() except that it supports only one relocation symbol.

## RETURN VALUES

On success, these functions return the index value for the added frame descriptor. In case of an error, these functions return DW\_DLV\_NOCOUNT and set the argument *err*.

## ERRORS

These functions can fail with:

- \[DW\_DLE\_ARGUMENT\]

  One of the arguments *dbg* or *fde* was NULL.

- \[DW\_DLE\_ARGUMENT\]

  The frame descriptor referenced by argument *fde* did not belong to the producer instance referenced by argument *dbg*.

- \[DW\_DLE\_ARGUMENT\]

  The common information entry index specified by argument *cie* was invalid.

- \[DW\_DLE\_ARGUMENT\]

  Argument *end\_symbol\_index* was non-zero, but the flag DW\_DLC\_SYMBOLIC\_RELOCATIONS was not set on the producer instance.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_add\_fde\_inst(3)](/dwarf_add_fde_inst/3.md), [dwarf\_add\_frame\_cie(3)](/dwarf_add_frame_cie/3.md), [dwarf\_fde\_cfa\_offset(3)](/dwarf_fde_cfa_offset/3.md), [dwarf\_get\_relocation\_info(3)](/dwarf_get_relocation_info/3.md), [dwarf\_new\_fde(3)](/dwarf_new_fde/3.md), [dwarf\_producer\_init(3)](/dwarf_producer_init/3.md), [dwarf\_producer\_init\_b(3)](/dwarf_producer_init_b/3.md)
