~ubuntu-branches/ubuntu/warty/quagga/warty

« back to all changes in this revision

Viewing changes to lib/debug.c

  • Committer: Bazaar Package Importer
  • Author(s): Fabio M. Di Nitto
  • Date: 2004-06-29 09:50:59 UTC
  • Revision ID: james.westby@ubuntu.com-20040629095059-px1m2m108z4qw1mr
Tags: upstream-0.96.5
ImportĀ upstreamĀ versionĀ 0.96.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <zebra.h>
 
2
#include "log.h"
 
3
 
 
4
void 
 
5
debug_print_trace (int signal)
 
6
{
 
7
#ifdef HAVE_GLIBC_BACKTRACE
 
8
    void *array[10];
 
9
    size_t size;
 
10
    char **strings;   
 
11
    size_t i;
 
12
 
 
13
    size = backtrace (array, 10);
 
14
    strings = backtrace_symbols (array, size);
 
15
 
 
16
    printf ("Obtained %zd stack frames.\n", size);
 
17
 
 
18
    for (i = 0; i < size; i++)
 
19
      printf ("%s\n", strings[i]);
 
20
 
 
21
    free (strings);
 
22
#endif /* HAVE_GLIBC_BACKTRACE */
 
23
    
 
24
    exit(1);
 
25
}