Back to index

glibc  2.9
Classes | Functions
backtrace.c File Reference
#include <execinfo.h>
#include <stddef.h>
#include <bp-checks.h>
#include <sysdep.h>

Go to the source code of this file.


struct  layout


int __backtrace (void **array, int size)

Class Documentation

struct layout

Definition at line 21 of file frame.h.

Collaboration diagram for layout:
Class Members
int back_chain
long back_chain
long condition_register
struct layout * ebp
long empty
int empty
long end_of_stack
int end_of_stack
int glue
unsigned long ins
unsigned long locals
void *__unbounded next
struct layout *__unbounded next
void * next
unsigned long next
void * ret
void *__unbounded return_address
void * return_address
long save_fp
int save_fp
long save_grps
int save_grps
long scratch
int scratch
void *__unbounded sp

Function Documentation

int __backtrace ( void **  array,
int  size 

Definition at line 35 of file backtrace.c.

  struct layout *current;
  unsigned long fp;
  int count;

  asm volatile ("flushw");
  asm volatile ("mov %%fp, %0" : "=r"(fp));
  current = (struct layout *__unbounded) (fp + STACK_BIAS);
  current = BOUNDED_1 (current);

  for (count = 0; count < size; count++)
      array[count] = current->return_address;
      if (!current->next)
      current = (struct layout *__unbounded) (current->next + STACK_BIAS);
      current = BOUNDED_1 (current);

  return count;