Back to index

glibc  2.9
Functions | Variables
execinfo.h File Reference
#include <debug/execinfo.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


int __backtrace (void **__array, int __size)
 libc_hidden_proto (__backtrace) extern char **__backtrace_symbols(void *__const *__array
void __backtrace_symbols_fd (void *__const *__array, int __size, int __fd)


int __size

Function Documentation

int __backtrace ( void **  __array,
int  __size 

Definition at line 63 of file backtrace.c.

  struct layout *current;
  void *__unbounded top_frame;
  void *__unbounded top_stack;
  int cnt = 0;

  top_frame = FIRST_FRAME_POINTER;
  top_stack = CURRENT_STACK_FRAME;

  /* We skip the call to this function, it makes no sense to record it.  */
  current = BOUNDED_1 ((struct layout *) top_frame);
  while (cnt < size)
      if ((void *) current INNER_THAN top_stack
         || !((void *) current INNER_THAN __libc_stack_end))
       /* This means the address is out of range.  Note that for the
         toplevel we see a frame pointer with value NULL which clearly is
         out of range.  */

      array[cnt++] = current->return_address;

      current = ADVANCE_STACK_FRAME (current->next);

  return cnt;

Here is the call graph for this function:

Here is the caller graph for this function:

void __backtrace_symbols_fd ( void *__const __array,
int  __size,
int  __fd 

Variable Documentation

Definition at line 7 of file execinfo.h.