Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv27684
Modified Files:
regdump.c
Log Message:
Deal with inaccessible virtual addresses in hex_dump()
Index: regdump.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/regdump.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- regdump.c 2001/01/17 16:13:57 1.1
+++ regdump.c 2001/01/29 00:57:00 1.2
@@ -14,8 +14,8 @@
#include <asm/psl.h>
#include <asm/ptrace.h>
#include <asm/system.h>
+#include <asm/uaccess.h>
-
void show_regs(struct pt_regs *regs)
{
struct psl_fields *psl;
@@ -100,14 +100,22 @@
void hex_dump(void *addr, unsigned int bytes)
{
- unsigned int *p = (unsigned int *)addr;
+ unsigned int *p = addr;
unsigned int i;
+ unsigned int x;
- for (i=0; i<bytes; i+=4) {
- printk(" %08x %08x %08x %08x %08x\n",
- (unsigned int)(p + i),
- p[i], p[i+1],
- p[i+2], p[i+3]);
+ for (i=0; i<bytes/4; i++) {
+ if (i%4 == 0) {
+ printk(" %08lx ", (unsigned long)(p+i));
+ }
+ if (get_user(x, p+i)) {
+ printk(" --------");
+ } else {
+ printk(" %08x", x);
+ }
+ if (i%4 == 3) {
+ printk("\n");
+ }
}
}
@@ -160,7 +168,7 @@
target_sp += (target_ap->argc + 1);
}
- hex_dump(target_sp, 32);
+ hex_dump(target_sp, 256);
}
void dump_cur_regs(unsigned int frames)
|