[PATCH][2.1.66] to show_registers()

Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Sat, 29 Nov 1997 17:53:25 +0000 (GMT)


Hi,

Here's a slightly trivial, mostly cosmetic patch which
disables the "Code: xx xx xx etc" display when an Oops
occurs when trying to dereference a NULL pointer to
code.

I don't know if this is suitable, correct, or any of
that stuff -- perhaps it would be more suitable to display
the code from the calling routine?

Matthew.

--- linux-2.1.66/arch/i386/kernel/traps.c Sat Nov 29 17:44:00 1997
+++ linux/arch/i386/kernel/traps.c Sat Nov 29 17:45:07 1997
@@ -177,8 +177,11 @@
}
}
printk("\nCode: ");
- for(i=0;i<20;i++)
- printk("%02x ",0xff & get_seg_byte(regs->xcs & 0xffff,(i+(char *)regs->eip)));
+ if(regs->eip)
+ for(i=0;i<20;i++)
+ printk("%02x ",0xff & get_seg_byte(regs->xcs & 0xffff,(i+(char *)regs->eip)));
+ else
+ printk("Not printed (NULL EIP)");
printk("\n");
}