Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > U

U_STACK_TRACE(3X)

Itanium(R)-based System Only
HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

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() 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 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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.