United States-English |
|
|
HP-UX Reference > UU_STACK_TRACE(3X)Itanium(R)-based System OnlyHP-UX 11i Version 3: February 2007 |
|
NAMEU_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); DESCRIPTIONU_STACK_TRACE() prints a formatted stack trace to standard error. _UNW_STACK_TRACE() produces 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 USAGEU_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(). ERRORSU_STACK_TRACE() can fail to give the entire stack back trace under the following conditions:
EXAMPLESGiven 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] |
Printable version | ||
|