source: trunk/minix/servers/inet/stacktrace.c@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 509 bytes
RevLine 
[9]1/*
2stacktrace.c
3
4Created: Jan 19, 1993 by Philip Homburg
5
6Copyright 1995 Philip Homburg
7*/
8
9#include "inet.h"
10
11PUBLIC void stacktrace()
12{
13 typedef unsigned int reg_t;
14 reg_t bp, pc, hbp;
15 extern reg_t get_bp ARGS(( void ));
16
17 bp= get_bp();
18 while(bp)
19 {
20 pc= ((reg_t *)bp)[1];
21 hbp= ((reg_t *)bp)[0];
22 printf("0x%lx ", (unsigned long)pc);
23 if (hbp != 0 && hbp <= bp)
24 {
25 printf("???");
26 break;
27 }
28 bp= hbp;
29 }
30 printf("\n");
31}
32
33/*
34 * $PchId: stacktrace.c,v 1.6 1996/05/07 21:11:34 philip Exp $
35 */
Note: See TracBrowser for help on using the repository browser.