From f224558e27c2e5f7cced612d0a7736d5e7bfcd1b Mon Sep 17 00:00:00 2001 From: thorpej Date: Wed, 9 Apr 1997 21:07:26 +0000 Subject: [PATCH] Garbage-collect regdump() and friends. --- sys/arch/x68k/x68k/machdep.c | 96 +----------------------------------- 1 file changed, 1 insertion(+), 95 deletions(-) diff --git a/sys/arch/x68k/x68k/machdep.c b/sys/arch/x68k/x68k/machdep.c index 3a824714c13a..a3e46f9b607d 100644 --- a/sys/arch/x68k/x68k/machdep.c +++ b/sys/arch/x68k/x68k/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.10 1997/04/03 17:49:08 christos Exp $ */ +/* $NetBSD: machdep.c,v 1.11 1997/04/09 21:07:26 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -92,7 +92,6 @@ #include -void dumpmem __P((int *, int, int)); void initcpu __P((void)); void identifycpu __P((void)); void doboot __P((void)) @@ -1535,99 +1534,6 @@ nmihand(frame) printf("unexpected level 7 interrupt ignored\n"); } -void -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)) - -void -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().