---
name: "dwarf_expr_current_offset"
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_current_offset"
---

# dwarf\_expr\_current\_offset(3)

retrieve the number of bytes in a location expression stream

## NAME

**dwarf\_expr\_current\_offset** – retrieve the number of bytes in a location expression stream

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*Dwarf\_Unsigned*\

**dwarf\_expr\_current\_offset**(*Dwarf\_P\_Expr expr*, *Dwarf\_Error \*err*);

## DESCRIPTION

Function **dwarf\_expr\_current\_offset**() returns the size in bytes of the 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).

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\_current\_offset**() returns the size in bytes of the location descriptor's stream representation. In case of an error, function **dwarf\_expr\_current\_offset**() returns DW\_DLV\_NOCOUNT and sets the argument *err*.

## ERRORS

Function **dwarf\_expr\_current\_offset**() can fail with:

- \[DW\_DLE\_ARGUMENT\]

  Argument *expr* was NULL.

## SEE ALSO

[dwarf(3)](/dwarf/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\_into\_block(3)](/dwarf_expr_into_block/3.md), [dwarf\_new\_expr(3)](/dwarf_new_expr/3.md)
