libtrbase  1.0.2
Web server and task management solution.
print_trace.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <execinfo.h>
+ Include dependency graph for print_trace.c:

Go to the source code of this file.

Functions

void print_trace (void)
 

Detailed Description

Author
The GNU Software Foundation.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file print_trace.c.

Function Documentation

void print_trace ( void  )

Definition at line 40 of file print_trace.c.

References memSegment::size.

41 {
42  void * array[10];
43  size_t size;
44  char ** strings;
45  size_t i;
46 
47  size = backtrace (array, 10);
48  strings = backtrace_symbols (array, size);
49 
50  printf ("Obtained %zd stack frames.\n", size);
51 
52  for (i = 0; i < size; i++)
53  printf ("%s\n", strings[i]);
54 
55  free (strings);
56 }
size_t size
Definition: memory.h:34