summaryrefslogtreecommitdiff
path: root/sys/arch/mvme68k/stand/libsa/panic.c
blob: 6c035aabe11c413a7f8c3aeb8716e8ca8cd1593a (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
32
/*	$OpenBSD: panic.c,v 1.3 1996/04/28 10:49:07 deraadt Exp $ */

#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]);
	}
}