arm: protect state after signal handler
[minix.git] / lib / libsys / stacktrace.c
blob8185956a92492aa1f838ab66afc245d688da5524
1 /*
2 stacktrace.c
4 Created: Jan 19, 1993 by Philip Homburg
6 Copyright 1995 Philip Homburg
7 */
9 #include <stdio.h>
10 #include <string.h>
12 typedef unsigned int reg_t;
14 extern reg_t get_bp(void);
16 void util_stacktrace(void)
18 #if USE_SYSDEBUG
19 reg_t bp, pc, hbp;
21 bp= get_bp();
22 while(bp)
24 pc= ((reg_t *)bp)[1];
25 hbp= ((reg_t *)bp)[0];
26 printf("0x%lx ", (unsigned long) pc);
27 if (hbp != 0 && hbp <= bp)
29 printf("0x%lx ", (unsigned long) -1);
30 break;
32 bp= hbp;
34 printf("\n");
35 #endif /* USE_SYSDEBUG */