blob: f7c83a6d8e7bb651743971cb7ec3f24354ade5b3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include <stdarg.h>
#include "stand.h"
extern volatile void abort();
extern int _estack[];
__dead void
panic(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
printf(fmt, ap);
printf("\n");
va_end(ap);
stackdump(0);
abort();
}
stackdump(dummy)
int dummy;
{
int *ip;
printf("stackdump:\n");
for (ip = &dummy; ip < _estack; ip += 4) {
printf("%x: %x %x %x %x\n",
(int)ip, ip[0], ip[1], ip[2], ip[3]);
}
}
|