2003-03-31 21:57:09 +02:00
\documentclass { article}
\usepackage [fancyhdr,pdf] { latex2man}
\input { common.tex}
\begin { document}
\begin { Name} { 3} { unw\_ get\_ proc\_ info} { David Mosberger-Tang} { Programming Library} { unw\_ get\_ proc\_ info} unw\_ get\_ proc\_ info -- get info on current procedure
\end { Name}
\section { Synopsis}
\File { \# include $ < $ libunwind.h$ > $ } \\
\Type { int} \Func { unw\_ get\_ proc\_ info} (\Type { unw\_ cursor\_ t~*} \Var { cp} , \Type { unw\_ proc\_ info\_ t~*} \Var { pip} );\\
\section { Description}
The \Func { unw\_ get\_ proc\_ info} () routine returns auxiliary
information about the procedure that created the stack frame
identified by argument \Var { cp} . The \Var { pip} argument is a pointer
to a structure of type \Type { unw\_ proc\_ info\_ t} which is used to
return the information. The \Type { unw\_ proc\_ info\_ t} has the
following members:
\begin { description}
\item [\Type{unw\_word\_t} \Var{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 \Var { start\_ ip}
member is cleared to 0. \\
\item [\Type{unw\_word\_t} \Var{end\_ip}] The address of the first
instruction \emph { beyond} the end of the procedure. If this address
cannot be determined (e.g., due to lack of unwind information),
the \Var { end\_ ip} member is cleared to 0. \\
2017-05-09 04:52:00 +02:00
\item [\Type{unw\_word\_t} \Var{last\_ip}] The address of the first
instruction that could begin another procedure. Addresses from
end\_ ip up to last\_ ip are addresses where there are no
instructions. If this address cannot be determined (e.g., due to
lack of unwind information), the \Var { end\_ ip} member is cleared to
0. \\
2003-03-31 21:57:09 +02:00
\item [\Type{unw\_word\_t} \Var{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. \\
\item [\Type{unw\_word\_t} \Var{handler}] The address of the exception
handler routine. This is sometimes called the \emph { personality}
routine. If the procedure does not define
a personality routine, the \Var { handler} member is cleared to 0. \\
\item [\Type{unw\_word\_t} \Var{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. \\
\item [\Type{unw\_word\_t} \Var{flags}] A set of flags. There are
currently no target-independent flags. For the IA-64 target, the
2004-08-05 10:59:57 +02:00
flag \Const { UNW\_ PI\_ FLAG\_ IA64\_ RBS\_ SWITCH} is set if the
2003-03-31 21:57:09 +02:00
procedure may switch the register-backing store.\\
\item [\Type{int} \Var{format}] The format of the unwind-info for this
procedure. If the unwind-info consists of dynamic procedure info,
\Var { format} is equal to \Const { UNW\_ INFO\_ FORMAT\_ DYNAMIC} . If the
unwind-info consists of a (target-specific) unwind table, it is
equal to to \Const { UNW\_ INFO\_ FORMAT\_ TABLE} . All other values are
reserved for future use by \Prog { libunwind} . This member exists
for use by the \Func { find\_ proc\_ info} () call-back (see
\Func { unw\_ create\_ addr\_ space} (3)). The
\Func { unw\_ get\_ proc\_ info} () routine
may return an undefined value in this member. \\
\item [\Type{int} \Var{unwind\_info\_size}] The size of the unwind-info
in bytes. This member exists for use by the
\Func { find\_ proc\_ info} () call-back (see
\Func { unw\_ create\_ addr\_ space} (3)). The
\Func { unw\_ get\_ proc\_ info} () routine
may return an undefined value in this member.\\
\item [\Type{void~*}\Var{unwind\_info}] The pointer to the unwind-info.
If no unwind info is available, this member must be set to
\Const { NULL} . This member exists for use by the
\Func { find\_ proc\_ info} () call-back (see
\Func { unw\_ create\_ addr\_ space} (3)). The
\Func { unw\_ get\_ proc\_ info} () routine
may return an undefined value in this member.\\
\end { description}
Note that for the purposes of \Prog { libunwind} , the code of a
procedure is assumed to occupy a single, contiguous range of
addresses. For this reason, it is alwas possible to describe the
extent of a procedure with the \Var { start\_ ip} and \Var { end\_ ip}
members. If a single function/routine is split into multiple,
discontiguous pieces, \Prog { libunwind} will treat each piece as a
separate procedure.
\section { Return Value}
On successful completion, \Func { unw\_ get\_ proc\_ info} () returns 0.
Otherwise the negative value of one of the error-codes below is
returned.
\section { Thread and Signal Safety}
2004-03-31 09:42:38 +02:00
\Func { unw\_ get\_ proc\_ info} () is thread-safe. If cursor \Var { cp} is
in the local address-space, this routine is also safe to use from a
signal handler.
2003-03-31 21:57:09 +02:00
\section { Errors}
\begin { Description}
\item [\Const{UNW\_EUNSPEC}] An unspecified error occurred.
\item [\Const{UNW\_ENOINFO}] \Prog { Libunwind} was unable to locate
unwind-info for the procedure.
\item [\Const{UNW\_EBADVERSION}] The unwind-info for the procedure has
version or format that is not understood by \Prog { libunwind} .
\end { Description}
In addition, \Func { unw\_ get\_ proc\_ info} () may return any error
returned by the \Func { access\_ mem} () call-back (see
\Func { unw\_ create\_ addr\_ space} (3)).
\section { See Also}
\SeeAlso { libunwind(3)} ,
\SeeAlso { unw\_ create\_ addr\_ space(3)} ,
\SeeAlso { unw\_ get\_ proc\_ name(3)}
\section { Author}
\noindent
David Mosberger-Tang\\
2007-08-22 20:49:08 +02:00
Email: \Email { dmosberger@gmail.com} \\
WWW: \URL { http://www.nongnu.org/libunwind/} .
2003-03-31 21:57:09 +02:00
\LatexManEnd
\end { document}