4 Created: Jan 19, 1993 by Philip Homburg
6 Copyright 1995 Philip Homburg
12 typedef unsigned int reg_t
;
14 #define FUNC_STACKTRACE(statement) \
17 extern reg_t get_bp(void); \
22 pc= ((reg_t *)bp)[1]; \
23 hbp= ((reg_t *)bp)[0]; \
25 if (hbp != 0 && hbp <= bp) \
35 void util_nstrcat(char *str
, unsigned long number
)
42 for(n
= 0; n
< 8; n
++) {
44 i
= (number
>> ((7-n
)*4)) & 0xF;
46 *p
++ = i
< 10 ? '0' + i
: 'a' + i
- 10;
56 void util_stacktrace(void)
58 FUNC_STACKTRACE(printf("0x%lx ", (unsigned long) pc
));
62 void util_stacktrace_strcat(char *str
)
64 FUNC_STACKTRACE(util_nstrcat(str
, pc
));