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/arch/sun3 | |
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/arch/sun3')
-rw-r--r-- | sys/arch/sun3/include/machdep.h | 4 | ||||
-rw-r--r-- | sys/arch/sun3/sun3/machdep.c | 94 |
2 files changed, 2 insertions, 96 deletions
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(). * |