Rev | Line | |
---|
[9] | 1 | /*
|
---|
| 2 | stacktrace.c
|
---|
| 3 |
|
---|
| 4 | Created: Jan 19, 1993 by Philip Homburg
|
---|
| 5 |
|
---|
| 6 | Copyright 1995 Philip Homburg
|
---|
| 7 | */
|
---|
| 8 |
|
---|
| 9 | #include "inet.h"
|
---|
| 10 |
|
---|
| 11 | PUBLIC 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.