---
name: "dwarf_expr_into_block"
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_expr_into_block"
---

# dwarf\_expr\_into\_block(3)

retrieve the byte stream for a location expression

## NAME

**dwarf\_expr\_into\_block** – retrieve the byte stream for a location expression

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*Dwarf\_Addr*\

**dwarf\_expr\_into\_block**(*Dwarf\_P\_Expr expr*, *Dwarf\_Unsigned \*length*, *Dwarf\_Error \*err*);

## DESCRIPTION

Function **dwarf\_expr\_into\_block**() retrieves the byte stream representation of a location expression.

Argument *expr* should reference a location expression descriptor allocated using [dwarf\_new\_expr(3)](/dwarf_new_expr/3.md).

Argument *length* should point to a location which will hold the size in bytes of the retrieved byte stream.

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

## RETURN VALUES

On success, function **dwarf\_expr\_into\_block**() returns the address of the first byte of the generated byte stream. In case of an error, function **dwarf\_expr\_into\_block**() returns DW\_DLV\_BADADDR and sets the argument *err*.

## ERRORS

Function **dwarf\_expr\_into\_block**() can fail with:

- \[DW\_DLE\_ARGUMENT\]

  One of the arguments *expr* or *length* was NULL.

- \[DW\_DLE\_MEMORY\]

  An out of memory condition was encountered during the execution of the function.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_add\_AT\_location\_expr(3)](/dwarf_add_AT_location_expr/3.md), [dwarf\_add\_expr\_addr(3)](/dwarf_add_expr_addr/3.md), [dwarf\_add\_expr\_addr\_b(3)](/dwarf_add_expr_addr_b/3.md), [dwarf\_add\_expr\_gen(3)](/dwarf_add_expr_gen/3.md), [dwarf\_expr\_current\_offset(3)](/dwarf_expr_current_offset/3.md), [dwarf\_new\_expr(3)](/dwarf_new_expr/3.md)
