Oops, the last patch has a stupid mistake displaying r1-r3. Fixed patch attached. Gerald On Fri, 2002-09-27 at 15:47, Gerald Champagne wrote: > The following trivial patch makes show_regs display register names > before each value. I find this format much faster to read when > comparing register dumps to assembly code. The results look like this: > > $0: at=00000000 v0=90008400 v1=00000037 > $4: a0=8023a934 a1=00000001 a2=81275e64 a3=00000562 > $8: t0=00000562 t1=81275d38 t2=7a797877 t3=4a494847 > $12: t4=80268356 t5=fffffffe t6=00000010 t7=4e4d4c4b > $16: s0=ffffffff s1=b8000800 s2=802647b0 s3=00000000 > $20: s4=00000000 s5=00000000 s6=00000004 s7=000000ff > $24: t8=ffffffff t9=00000001 k0=........ k1=........ > $28: gp=81274000 sp=81275e20 fp=00000000 ra=80211c6c > > Is this acceptable, or do people prefer the existing method without the > register names? > > Gerald > > > ---- > > --- linux.orig/arch/mips/kernel/traps.c Sun Dec 2 05:34:38 2001 > +++ linux/arch/mips/kernel/traps.c Fri Sep 27 15:28:08 2002 > @@ -291,17 +291,21 @@ > /* > * Saved main processor registers > */ > - printk("$0 : %08x %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", > - 0, regs->regs[1], regs->regs[2], regs->regs[3], > + printk(" $0: at=%08lx v0=%08lx v1=%08lx\n", > + 0, regs->regs[1], regs->regs[2], regs->regs[3]); > + printk(" $4: a0=%08lx a1=%08lx a2=%08lx a3=%08lx\n", > regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]); > - printk("$8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", > - regs->regs[8], regs->regs[9], regs->regs[10], regs->regs[11], > + printk(" $8: t0=%08lx t1=%08lx t2=%08lx t3=%08lx\n", > + regs->regs[8], regs->regs[9], regs->regs[10], regs->regs[11]); > + printk("$12: t4=%08lx t5=%08lx t6=%08lx t7=%08lx\n", > regs->regs[12], regs->regs[13], regs->regs[14], regs->regs[15]); > - printk("$16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", > - regs->regs[16], regs->regs[17], regs->regs[18], regs->regs[19], > + printk("$16: s0=%08lx s1=%08lx s2=%08lx s3=%08lx\n", > + regs->regs[16], regs->regs[17], regs->regs[18], regs->regs[19]); > + printk("$20: s4=%08lx s5=%08lx s6=%08lx s7=%08lx\n", > regs->regs[20], regs->regs[21], regs->regs[22], regs->regs[23]); > - printk("$24: %08lx %08lx %08lx %08lx %08lx %08lx\n", > - regs->regs[24], regs->regs[25], > + printk("$24: t8=%08lx t9=%08lx k0=........ k1=........\n", > + regs->regs[24], regs->regs[25]); > + printk("$28: gp=%08lx sp=%08lx fp=%08lx ra=%08lx\n", > regs->regs[28], regs->regs[29], regs->regs[30], regs->regs[31]); > printk("Hi : %08lx\n", regs->hi); > printk("Lo : %08lx\n", regs->lo);
--- linux.orig/arch/mips/kernel/traps.c Sun Dec 2 05:34:38 2001 +++ linux/arch/mips/kernel/traps.c Fri Sep 27 15:51:06 2002 @@ -291,17 +291,21 @@ /* * Saved main processor registers */ - printk("$0 : %08x %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - 0, regs->regs[1], regs->regs[2], regs->regs[3], + printk(" $0: at=%08lx v0=%08lx v1=%08lx\n", + regs->regs[1], regs->regs[2], regs->regs[3]); + printk(" $4: a0=%08lx a1=%08lx a2=%08lx a3=%08lx\n", regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]); - printk("$8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - regs->regs[8], regs->regs[9], regs->regs[10], regs->regs[11], + printk(" $8: t0=%08lx t1=%08lx t2=%08lx t3=%08lx\n", + regs->regs[8], regs->regs[9], regs->regs[10], regs->regs[11]); + printk("$12: t4=%08lx t5=%08lx t6=%08lx t7=%08lx\n", regs->regs[12], regs->regs[13], regs->regs[14], regs->regs[15]); - printk("$16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - regs->regs[16], regs->regs[17], regs->regs[18], regs->regs[19], + printk("$16: s0=%08lx s1=%08lx s2=%08lx s3=%08lx\n", + regs->regs[16], regs->regs[17], regs->regs[18], regs->regs[19]); + printk("$20: s4=%08lx s5=%08lx s6=%08lx s7=%08lx\n", regs->regs[20], regs->regs[21], regs->regs[22], regs->regs[23]); - printk("$24: %08lx %08lx %08lx %08lx %08lx %08lx\n", - regs->regs[24], regs->regs[25], + printk("$24: t8=%08lx t9=%08lx k0=........ k1=........\n", + regs->regs[24], regs->regs[25]); + printk("$28: gp=%08lx sp=%08lx fp=%08lx ra=%08lx\n", regs->regs[28], regs->regs[29], regs->regs[30], regs->regs[31]); printk("Hi : %08lx\n", regs->hi); printk("Lo : %08lx\n", regs->lo);