diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2001-08-25 11:37:27 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2001-08-25 11:37:27 +0000 |
commit | 3358591713cd093d08ab6943b2bc0a9cb505d70a (patch) | |
tree | 10f14f7945ac6a03b6904f761b82615df35b6e54 /sys | |
parent | 17f1f0da9189e82c93381a61aace686d52339576 (diff) |
One regdump to dump them all...
(moid@ wants that commit, because it interferes with stuff he's cleaning,
and he's prepared to clean up stuff I may have forgotten, even though this
was tested)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amiga/conf/files.amiga | 5 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/machdep.c | 95 | ||||
-rw-r--r-- | sys/arch/hp300/hp300/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/hp300/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/arch/m68k/conf/files.m68k | 4 | ||||
-rw-r--r-- | sys/arch/m68k/include/cpu.h | 7 | ||||
-rw-r--r-- | sys/arch/mac68k/include/reg.h | 7 | ||||
-rw-r--r-- | sys/arch/mac68k/mac68k/machdep.c | 66 | ||||
-rw-r--r-- | sys/arch/mac68k/mac68k/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/machdep.c | 93 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/sun3/include/machdep.h | 4 | ||||
-rw-r--r-- | sys/arch/sun3/sun3/machdep.c | 94 |
13 files changed, 25 insertions, 365 deletions
diff --git a/sys/arch/amiga/conf/files.amiga b/sys/arch/amiga/conf/files.amiga index 5e2c9067c75..110a2eb74a7 100644 --- a/sys/arch/amiga/conf/files.amiga +++ b/sys/arch/amiga/conf/files.amiga @@ -1,4 +1,4 @@ -# $OpenBSD: files.amiga,v 1.42 2001/08/19 14:42:06 espie Exp $ +# $OpenBSD: files.amiga,v 1.43 2001/08/25 11:37:26 espie Exp $ # $NetBSD: files.amiga,v 1.62 1997/08/27 19:32:47 is Exp $ @@ -366,9 +366,6 @@ file arch/amiga/amiga/vm_machdep.c file arch/amiga/amiga/cc.c file arch/amiga/amiga/db_memrw.c ddb -# XXX to be moved to files.m68k after 2.2 -file arch/m68k/m68k/regdump.c - major {wd = 0} major {fd = 2} major {sd = 4} diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c index cf565a16e5f..58a34f441ab 100644 --- a/sys/arch/hp300/hp300/machdep.c +++ b/sys/arch/hp300/hp300/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.59 2001/08/23 14:01:03 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.60 2001/08/25 11:37:26 espie Exp $ */ /* $NetBSD: machdep.c,v 1.121 1999/03/26 23:41:29 mycroft Exp $ */ /* @@ -1175,7 +1175,7 @@ parityerror(fp) printf("WARNING: kernel parity error ignored\n"); #endif } else { - regdump(fp, 128); + regdump(&(fp->F_t), 128); panic("kernel parity error"); } return(1); @@ -1244,97 +1244,6 @@ done: return(found); } -void -regdump(fp, sbytes) - struct frame *fp; /* must not be register */ - int sbytes; -{ - static int doingdump = 0; - register int i; - int s; - - if (doingdump) - return; - s = splhigh(); - doingdump = 1; - printf("pid = %d, pc = %s, ", - curproc ? curproc->p_pid : -1, hexstr(fp->f_pc, 8)); - printf("ps = %s, ", hexstr(fp->f_sr, 4)); - printf("sfc = %s, ", hexstr(getsfc(), 4)); - printf("dfc = %s\n", hexstr(getdfc(), 4)); - printf("Registers:\n "); - for (i = 0; i < 8; i++) - printf(" %d", i); - printf("\ndreg:"); - for (i = 0; i < 8; i++) - printf(" %s", hexstr(fp->f_regs[i], 8)); - printf("\nareg:"); - for (i = 0; i < 8; i++) - printf(" %s", hexstr(fp->f_regs[i+8], 8)); - if (sbytes > 0) { - if (fp->f_sr & PSL_S) { - printf("\n\nKernel stack (%s):", - hexstr((int)(((int *)&fp)-1), 8)); - dumpmem(((int *)&fp)-1, sbytes, 0); - } else { - printf("\n\nUser stack (%s):", hexstr(fp->f_regs[SP], 8)); - dumpmem((int *)fp->f_regs[SP], sbytes, 1); - } - } - doingdump = 0; - splx(s); -} - -#define KSADDR ((int *)((u_int)curproc->p_addr + USPACE - NBPG)) - -void -dumpmem(ptr, sz, ustack) - register int *ptr; - int sz, ustack; -{ - register int i, val; - - for (i = 0; i < sz; i++) { - if ((i & 7) == 0) - printf("\n%s: ", hexstr((int)ptr, 6)); - else - printf(" "); - if (ustack == 1) { - if ((val = fuword(ptr++)) == -1) - break; - } else { - if (ustack == 0 && - (ptr < KSADDR || ptr > KSADDR+(NBPG/4-1))) - break; - val = *ptr++; - } - printf("%s", hexstr(val, 8)); - } - printf("\n"); -} - -char * -hexstr(val, len) - register int val; - int len; -{ - static char nbuf[9]; - register int x, i; - - if (len > 8) - return(""); - nbuf[len] = '\0'; - for (i = len-1; i >= 0; --i) { - x = val & 0xF; - if (x > 9) - nbuf[i] = x - 10 + 'A'; - else - nbuf[i] = x + '0'; - val >>= 4; - } - return(nbuf); -} - /* * cpu_exec_aout_makecmds(): * cpu-dependent a.out format hook for execve(). diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c index 309bf31cf7c..47765be5339 100644 --- a/sys/arch/hp300/hp300/trap.c +++ b/sys/arch/hp300/hp300/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.25 2001/07/25 13:25:31 art Exp $ */ +/* $OpenBSD: trap.c,v 1.26 2001/08/25 11:37:26 espie Exp $ */ /* $NetBSD: trap.c,v 1.57 1998/02/16 20:58:31 thorpej Exp $ */ /* @@ -355,7 +355,7 @@ trap(type, code, v, frame) printf("(press a key)\n"); (void)cngetc(); #endif } - regdump(&frame, 128); + regdump(&(frame.F_t), 128); type &= ~T_USER; if ((u_int)type < trap_types) panic(trap_type[type]); diff --git a/sys/arch/hp300/include/cpu.h b/sys/arch/hp300/include/cpu.h index ae4b0bb0b58..4e4ff631e12 100644 --- a/sys/arch/hp300/include/cpu.h +++ b/sys/arch/hp300/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.14 2001/08/20 19:49:03 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.15 2001/08/25 11:37:26 espie Exp $ */ /* $NetBSD: cpu.h,v 1.28 1998/02/13 07:41:51 scottr Exp $ */ /* @@ -182,7 +182,6 @@ void hp300_calibrate_delay __P((void)); /* machdep.c functions */ int badaddr __P((caddr_t)); int badbaddr __P((caddr_t)); -void regdump __P((struct frame *, int)); void dumpconf __P((void)); /* pmap.c functions */ diff --git a/sys/arch/m68k/conf/files.m68k b/sys/arch/m68k/conf/files.m68k index 48c49bcf276..85fc24a52bb 100644 --- a/sys/arch/m68k/conf/files.m68k +++ b/sys/arch/m68k/conf/files.m68k @@ -1,4 +1,4 @@ -# $OpenBSD: files.m68k,v 1.8 1997/07/06 07:46:20 downsj Exp $ +# $OpenBSD: files.m68k,v 1.9 2001/08/25 11:37:26 espie Exp $ # $NetBSD: files.m68k,v 1.18 1997/06/06 23:15:28 veego Exp $ # file arch/m68k/m68k/db_disasm.c ddb @@ -16,5 +16,7 @@ file arch/m68k/m68k/random.s file arch/m68k/m68k/copy.s file arch/m68k/m68k/bcopy.s file arch/m68k/m68k/copypage.s +file arch/m68k/m68k/regdump.c + include "../../../compat/m68k4k/files.m68k4k" diff --git a/sys/arch/m68k/include/cpu.h b/sys/arch/m68k/include/cpu.h index f4e33bc9bfc..2723dcb9169 100644 --- a/sys/arch/m68k/include/cpu.h +++ b/sys/arch/m68k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.5 2001/08/20 20:24:07 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.6 2001/08/25 11:37:26 espie Exp $ */ /* $NetBSD: cpu.h,v 1.3 1997/02/02 06:56:57 thorpej Exp $ */ /* @@ -205,6 +205,11 @@ u_long getsfc __P((void)); int fusword __P((caddr_t)); int susword __P((caddr_t, u_short)); +/* regdump.c */ +struct trapframe; +void regdump __P((struct trapframe *, int)); + + #endif /* _KERNEL */ #endif /* _M68K_CPU_H_ */ diff --git a/sys/arch/mac68k/include/reg.h b/sys/arch/mac68k/include/reg.h index a8765eb7f05..b52c1bb9b31 100644 --- a/sys/arch/mac68k/include/reg.h +++ b/sys/arch/mac68k/include/reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: reg.h,v 1.4 1997/11/30 06:12:35 gene Exp $ */ +/* $OpenBSD: reg.h,v 1.5 2001/08/25 11:37:26 espie Exp $ */ /* $NetBSD: reg.h,v 1.10 1996/05/05 06:18:00 briggs Exp $ */ #ifndef _MAC68K_REG_H_ @@ -7,9 +7,4 @@ #include <machine/frame.h> #include <m68k/reg.h> -__BEGIN_DECLS -/* machdep.c */ -void regdump __P((struct frame *, int)); -__END_DECLS - #endif /* _MAC68K_REG_H_ */ diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c index 6634d4bd276..d48a0de536c 100644 --- a/sys/arch/mac68k/mac68k/machdep.c +++ b/sys/arch/mac68k/mac68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.78 2001/08/23 14:01:03 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.79 2001/08/25 11:37:26 espie Exp $ */ /* $NetBSD: machdep.c,v 1.207 1998/07/08 04:39:34 thorpej Exp $ */ /* @@ -1139,7 +1139,7 @@ nmihand(frame) if (nmihanddeep++) return; -/* regdump(&frame, 128); +/* regdump(&(frame->F_t), 128); dumptrace(); */ #ifdef DIAGNOSTIC printf("Panic switch: PC is 0x%x.\n", frame.f_pc); @@ -1151,68 +1151,6 @@ nmihand(frame) nmihanddeep = 0; } -void dumpmem __P((u_int *, int)); - -void -regdump(frame, sbytes) - struct frame *frame; - int sbytes; -{ - static int doingdump = 0; - register int i; - int s; - - if (doingdump) - return; - s = splhigh(); - doingdump = 1; - printf("pid = %d, pc = 0x%08x, ", curproc->p_pid, frame->f_pc); - printf("ps = 0x%08x, ", frame->f_sr); - printf("sfc = 0x%08x, ", getsfc()); - printf("dfc = 0x%08x\n", getdfc()); - printf("Registers:\n "); - for (i = 0; i < 8; i++) - printf(" %d", i); - printf("\ndreg:"); - for (i = 0; i < 8; i++) - printf(" %08x", frame->f_regs[i]); - printf("\nareg:"); - for (i = 0; i < 8; i++) - printf(" %08x", frame->f_regs[i + 8]); - if (sbytes > 0) { - if (1) { /* (frame->f_sr & PSL_S) *//* BARF - BG */ - printf("\n\nKernel stack (%08x):", - (int) (((int *)frame) - 1)); - dumpmem(((int *)frame) - 1, sbytes); - } else { - printf("\n\nUser stack (%08x):", frame->f_regs[15]); - dumpmem((int *)frame->f_regs[15], sbytes); - } - } - doingdump = 0; - splx(s); -} - -void dumpmem __P((u_int *, int)); - -void -dumpmem(ptr, sz) - register u_int *ptr; - int sz; -{ - register int i; - - sz /= 4; - for (i = 0; i < sz; i++) { - if ((i & 7) == 0) - printf("\n%08x: ", (u_int) ptr); - else - printf(" "); - printf("%08x ", *ptr++); - } - printf("\n"); -} - /* * It should be possible to probe for the top of RAM, but Apple has * memory structured so that in at least some cases, it's possible diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c index 11830547747..6f67b0f3b13 100644 --- a/sys/arch/mac68k/mac68k/trap.c +++ b/sys/arch/mac68k/mac68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.25 2001/07/25 13:25:32 art Exp $ */ +/* $OpenBSD: trap.c,v 1.26 2001/08/25 11:37:26 espie Exp $ */ /* $NetBSD: trap.c,v 1.68 1998/12/22 08:47:07 scottr Exp $ */ /* @@ -312,7 +312,7 @@ trap(type, code, v, frame) printf("(press a key)\n"); (void)cngetc(); #endif } - regdump(&frame, 128); + regdump(&(frame->F_t), 128); type &= ~T_USER; if ((u_int)type < trap_types) panic(trap_type[type]); diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c index 10a8d6c42aa..eca7c701e1a 100644 --- a/sys/arch/mvme68k/mvme68k/machdep.c +++ b/sys/arch/mvme68k/mvme68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.50 2001/08/23 14:01:03 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.51 2001/08/25 11:37:26 espie Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -1073,97 +1073,6 @@ struct frame *frame; #endif } -regdump(fp, sbytes) -struct frame *fp; /* must not be register */ -int sbytes; -{ - static int doingdump = 0; - register int i; - int s; - extern char *hexstr(); - - if (doingdump) - return; - s = splhigh(); - doingdump = 1; - printf("pid = %d, pc = %s, ", - curproc ? curproc->p_pid : -1, hexstr(fp->f_pc, 8)); - printf("ps = %s, ", hexstr(fp->f_sr, 4)); - printf("sfc = %s, ", hexstr(getsfc(), 4)); - printf("dfc = %s\n", hexstr(getdfc(), 4)); - printf("Registers:\n "); - for (i = 0; i < 8; i++) - printf(" %d", i); - printf("\ndreg:"); - for (i = 0; i < 8; i++) - printf(" %s", hexstr(fp->f_regs[i], 8)); - printf("\nareg:"); - for (i = 0; i < 8; i++) - printf(" %s", hexstr(fp->f_regs[i+8], 8)); - if (sbytes > 0) { - if (fp->f_sr & PSL_S) { - printf("\n\nKernel stack (%s):", - hexstr((int)(((int *)&fp)-1), 8)); - dumpmem(((int *)&fp)-1, sbytes, 0); - } else { - printf("\n\nUser stack (%s):", hexstr(fp->f_regs[SP], 8)); - dumpmem((int *)fp->f_regs[SP], sbytes, 1); - } - } - doingdump = 0; - splx(s); -} - -#define KSADDR ((int *)((u_int)curproc->p_addr + USPACE - NBPG)) - -dumpmem(ptr, sz, ustack) -register int *ptr; -int sz, ustack; -{ - register int i, val; - extern char *hexstr(); - - for (i = 0; i < sz; i++) { - if ((i & 7) == 0) - printf("\n%s: ", hexstr((int)ptr, 6)); - else - printf(" "); - if (ustack == 1) { - if ((val = fuword(ptr++)) == -1) - break; - } else { - if (ustack == 0 && - (ptr < KSADDR || ptr > KSADDR+(NBPG/4-1))) - break; - val = *ptr++; - } - printf("%s", hexstr(val, 8)); - } - printf("\n"); -} - -char * -hexstr(val, len) -register int val; -int len; -{ - static char nbuf[9]; - register int x, i; - - if (len > 8) - return (""); - nbuf[len] = '\0'; - for (i = len-1; i >= 0; --i) { - x = val & 0xF; - if (x > 9) - nbuf[i] = x - 10 + 'A'; - else - nbuf[i] = x + '0'; - val >>= 4; - } - return (nbuf); -} - /* * cpu_exec_aout_makecmds(): * cpu-dependent a.out format hook for execve(). diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c index 15a3a2d2311..8f93d2b4330 100644 --- a/sys/arch/mvme68k/mvme68k/trap.c +++ b/sys/arch/mvme68k/mvme68k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.33 2001/07/25 13:25:32 art Exp $ */ +/* $OpenBSD: trap.c,v 1.34 2001/08/25 11:37:26 espie Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -295,7 +295,7 @@ dopanic: if (kdb_trap(type, &frame)) return; #endif - regdump(&frame, 128); + regdump(&(frame.F_t), 128); type &= ~T_USER; if ((unsigned)type < trap_types) panic(trap_type[type]); diff --git a/sys/arch/sun3/include/machdep.h b/sys/arch/sun3/include/machdep.h index db623b7d097..ac195f63f87 100644 --- a/sys/arch/sun3/include/machdep.h +++ b/sys/arch/sun3/include/machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.h,v 1.14 2001/08/20 19:49:03 miod Exp $ */ +/* $OpenBSD: machdep.h,v 1.15 2001/08/25 11:37:26 espie Exp $ */ /* * Copyright (c) 1994 Gordon W. Ross @@ -123,8 +123,6 @@ void pmap_get_pagemap __P((int *pt, int off)); int reboot2 __P((int, char *)); -void regdump __P((struct frame *, int)); - void savectx __P((struct pcb *)); void setvbr __P((void **)); diff --git a/sys/arch/sun3/sun3/machdep.c b/sys/arch/sun3/sun3/machdep.c index 202608d72b2..e5e051484ad 100644 --- a/sys/arch/sun3/sun3/machdep.c +++ b/sys/arch/sun3/sun3/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.38 2001/08/23 14:01:03 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.39 2001/08/25 11:37:26 espie Exp $ */ /* $NetBSD: machdep.c,v 1.77 1996/10/13 03:47:51 christos Exp $ */ /* @@ -834,98 +834,6 @@ straytrap(frame) /* XXX: parityenable() ? */ /* - * Print a register and stack dump. - */ -void -regdump(fp, sbytes) - struct frame *fp; /* must not be register */ - int sbytes; -{ - static int doingdump = 0; - register int i; - int s; - - if (doingdump) - return; - s = splhigh(); - doingdump = 1; - printf("pid = %d, pc = %s, ", - curproc ? curproc->p_pid : -1, hexstr(fp->f_pc, 8)); - printf("ps = %s, ", hexstr(fp->f_sr, 4)); - printf("sfc = %s, ", hexstr(getsfc(), 4)); - printf("dfc = %s\n", hexstr(getdfc(), 4)); - printf("Registers:\n "); - for (i = 0; i < 8; i++) - printf(" %d", i); - printf("\ndreg:"); - for (i = 0; i < 8; i++) - printf(" %s", hexstr(fp->f_regs[i], 8)); - printf("\nareg:"); - for (i = 0; i < 8; i++) - printf(" %s", hexstr(fp->f_regs[i+8], 8)); - if (sbytes > 0) { - if (fp->f_sr & PSL_S) { - printf("\n\nKernel stack (%s):", - hexstr((int)(((int *)&fp)-1), 8)); - dumpmem(((int *)&fp)-1, sbytes, 0); - } else { - printf("\n\nUser stack (%s):", hexstr(fp->f_regs[SP], 8)); - dumpmem((int *)fp->f_regs[SP], sbytes, 1); - } - } - doingdump = 0; - splx(s); -} - -#define KSADDR ((int *)((u_int)curproc->p_addr + USPACE - NBPG)) - -void -dumpmem(ptr, sz, ustack) - register int *ptr; - int sz, ustack; -{ - register int i, val; - - for (i = 0; i < sz; i++) { - if ((i & 7) == 0) - printf("\n%s: ", hexstr((int)ptr, 6)); - else - printf(" "); - if (ustack == 1) { - if ((val = fuword(ptr++)) == -1) - break; - } else { - if (ustack == 0 && - (ptr < KSADDR || ptr > KSADDR+(NBPG/4-1))) - break; - val = *ptr++; - } - printf("%s", hexstr(val, 8)); - } - printf("\n"); -} - -char * -hexstr(val, len) - register int val; - int len; -{ - static char nbuf[9]; - register int x, i; - - if (len > 8) - return(""); - nbuf[len] = '\0'; - for (i = len-1; i >= 0; --i) { - x = val & 0xF; - /* Isn't this a cool trick? */ - nbuf[i] = "0123456789ABCDEF"[x]; - val >>= 4; - } - return(nbuf); -} - -/* * cpu_exec_aout_makecmds(): * cpu-dependent a.out format hook for execve(). * |