---
name: "unw_get_proc_info"
section: "3"
platform: "linux"
package: "libunwind"
version: "1.8.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/unw_get_proc_info"
---

# unw\_get\_proc\_info(3)

## NAME

unw\_get\_proc\_info -- get info on current procedure

## SYNOPSIS

\#include \<libunwind.h\>\

int unw\_get\_proc\_info(unw\_cursor\_t \*cp, unw\_proc\_info\_t \*pip);\

## DESCRIPTION

The unw\_get\_proc\_info() routine returns auxiliary  information about the procedure that created the stack frame  identified by argument cp. The pip argument is a pointer  to a structure of type unw\_proc\_info\_t which is used to  return the information. The unw\_proc\_info\_t has the  following members:

- unw\_word\_t start\_ip

   The address of the first  instruction of the procedure. If this address cannot be determined  (e.g., due to lack of unwind information), the start\_ip member is cleared to 0. \

- unw\_word\_t end\_ip

   The address of the first  instruction *beyond* the end of the procedure. If this address  cannot be determined (e.g., due to lack of unwind information),  the end\_ip member is cleared to 0. \

- unw\_word\_t lsda

   The address of the  language-specific data area (LSDA). This area normally contains  language-specific information needed during exception handling. If  the procedure has no such area, this member is cleared to 0. \

- unw\_word\_t handler

   The address of the exception  handler routine. This is sometimes called the *personality* routine. If the procedure does not define  a personality routine, the handler member is cleared to 0. \

- unw\_word\_t gp

   The global pointer of the  procedure. On platforms that do not use a global pointer, this  member may contain an undefined value. On all other platforms, it  must be set either to the correct global pointer value of the  procedure or to 0 if the proper global pointer cannot be  obtained for some reason. \

- unw\_word\_t flags

   A set of flags. There are  currently no target-independent flags. For the IA-64 target, the  flag UNW\_PI\_FLAG\_IA64\_RBS\_SWITCH is set if the  procedure may switch the register backing store.\

- int format

   The format of the unwind info for this  procedure. If the unwind info consists of dynamic procedure info,  format is equal to UNW\_INFO\_FORMAT\_DYNAMIC. If the  unwind info consists of a (target-specific) unwind table, it is  equal to UNW\_INFO\_FORMAT\_TABLE. All other values are  reserved for future use by libunwind. This member exists  for use by the find\_proc\_info() callback (see  unw\_create\_addr\_space(3libunwind)). The  unw\_get\_proc\_info() routine  may return an undefined value in this member. \

- int unwind\_info\_size

   The size of the unwind info  in bytes. This member exists for use by the  find\_proc\_info() callback (see  unw\_create\_addr\_space(3libunwind)). The  unw\_get\_proc\_info() routine  may return an undefined value in this member.\

- void \*unwind\_info

   The pointer to the unwind info.  If no unwind info is available, this member must be set to  NULL. This member exists for use by the  find\_proc\_info() callback (see  unw\_create\_addr\_space(3libunwind)). The  unw\_get\_proc\_info() routine  may return an undefined value in this member.\

Note that for the purposes of libunwind, the code of a  procedure is assumed to occupy a single, contiguous range of  addresses. For this reason, it is always possible to describe the  extent of a procedure with the start\_ip and end\_ip members. If a single function/routine is split into multiple,  discontiguous pieces, libunwind will treat each piece as a  separate procedure.

## RETURN VALUE

On successful completion, unw\_get\_proc\_info() returns 0.  Otherwise the negative value of one of the error codes below is  returned.

## THREAD AND SIGNAL SAFETY

unw\_get\_proc\_info() is thread safe. If cursor cp is  in the local address space, this routine is also safe to use from a  signal handler.

## ERRORS

- UNW\_EUNSPEC

   An unspecified error occurred.

- UNW\_ENOINFO

   Libunwind was unable to locate  unwind info for the procedure.

- UNW\_EBADVERSION

   The unwind info for the procedure has  version or format that is not understood by libunwind.

In addition, unw\_get\_proc\_info() may return any error  returned by the access\_mem() callback (see  unw\_create\_addr\_space(3libunwind)).

## SEE ALSO

libunwind(3libunwind), unw\_create\_addr\_space(3libunwind), unw\_get\_proc\_name(3libunwind)

## AUTHOR

David Mosberger-Tang\
 Email: **dmosberger@gmail.com**\
 WWW: **http://www.nongnu.org/libunwind/**.
