U_STACK_TRACE.3x (2010 09)

u
U_STACK_TRACE(3X) U_STACK_TRACE(3X)
(Itanium(R)-based System Only)
NAME
U_STACK_TRACE(), _UNW_STACK_TRACE() - produce a trace back of the procedure call stack using
the unwind library
SYNOPSIS
#include <unwind.h>
void U_STACK_TRACE();
_UNW_ReturnCode _UNW_STACK_TRACE(FILE * out_file);
DESCRIPTION
U_STACK_TRACE()
prints a formatted stack trace to standard error. _UNW_STACK_TRACE()
pro-
duces a formatted stack trace on the output stream indicated by parameter out_file. The stream must be
a writable stream for output to be produced.
APPLICATION USAGE
U_STACK_TRACE()
and _UNW_STACK_TRACE()
are thread-safe. They are not async-cancel-safe
because they make use of
fprintf(), which is not async-cancel-safe. A cancellation point may occur
when a thread is executing U_STACK_TRACE()
.
RETURN VALUE
None
ERRORS
U_STACK_TRACE() can fail to give the entire stack back trace under the following conditions:
Low memory conditions. The unwind library is not able to allocate enough memory to perform the
tasks of tracking back over the stack or of looking up symbols names associated with instruction
pointer addresses encountered.
Executables and shared libraries that fail to conform to the Runtime Architecture for Itanium-based
systems. For example, they may have invalid, incomplete, or missing unwind tables; or invalid or
incorrect unwind information blocks.
EXAMPLES
Given the following C program:
#include <unwind.h>
foo()
{
U_STACK_TRACE();
}
main()
{
foo();
}
Compiling and executing the program produces output similar to this:
(0) 0x0000000004000a00 foo + 0x10 [a.out]
(1) 0x0000000004000a50 main + 0x10 [a.out]
(2) 0x60000000c0066e20 main_opd_entry + 0x40 [/usr/lib/hpux32/dld.so]
AUTHOR
U_STACK_TRACE() was developed by HP.
SEE ALSO
_UNW_createContextForSelf(3X), _UNW_currentContext(3X), _UNW_getGR(3X), unwind(5).
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)