Return to backtrace.c CVS log | Up to [Pegasus] / pegasus_unsupported / src / backtrace |
File: [Pegasus] / pegasus_unsupported / src / backtrace / backtrace.c
(download)
Revision: 1.1, Wed Jan 25 22:32:20 2006 UTC (18 years, 4 months ago) by mike Branch: MAIN CVS Tags: HEAD PEP#: 9999 TITLE: Sample source to obtain a backtrace with GCC DESCRIPTION: Sample source to obtain a backtrace with GCC |
#include <stdio.h> #include <stdlib.h> #include <execinfo.h> void print_back_trace() { void *array[1024]; size_t size; char **strings; size_t i; size = backtrace(array, 1024); strings = backtrace_symbols(array, size); printf ("==== backtrace():\n"); for (i = 0; i < size; i++) { printf("%s\n", strings[i]); } free (strings); }
No CVS admin address has been configured |
Powered by ViewCVS 0.9.2 |