提交 f2325ece 编写于 作者: R Roman Zippel 提交者: Linus Torvalds

[PATCH] m68k: fix show_registers()

Move some of the prints in die_if_kernel() to show_registers() and call that
instead of show_stack(), so show_registers() prints now similiar info as other
archs.  Clean up the function a little.
Signed-off-by: NRoman Zippel <zippel@linux-m68k.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 742636f5
......@@ -927,12 +927,26 @@ void show_trace(unsigned long *stack)
void show_registers(struct pt_regs *regs)
{
struct frame *fp = (struct frame *)regs;
mm_segment_t old_fs = get_fs();
u16 c, *cp;
unsigned long addr;
int i;
print_modules();
printk("PC: [<%08lx>]",regs->pc);
print_symbol(" %s", regs->pc);
printk("\nSR: %04x SP: %p a2: %08lx\n",
regs->sr, regs, regs->a2);
printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
regs->d0, regs->d1, regs->d2, regs->d3);
printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
regs->d4, regs->d5, regs->a0, regs->a1);
printk("Process %s (pid: %d, task=%p)\n",
current->comm, current->pid, current);
addr = (unsigned long)&fp->un;
printk("Frame format=%X ", fp->ptregs.format);
switch (fp->ptregs.format) {
printk("Frame format=%X ", regs->format);
switch (regs->format) {
case 0x2:
printk("instr addr=%08lx\n", fp->un.fmt2.iaddr);
addr += sizeof(fp->un.fmt2);
......@@ -984,9 +998,17 @@ void show_registers(struct pt_regs *regs)
}
show_stack(NULL, (unsigned long *)addr);
printk("Code: ");
for (i = 0; i < 10; i++)
printk("%04x ", 0xffff & ((short *) fp->ptregs.pc)[i]);
printk("Code:");
set_fs(KERNEL_DS);
cp = (u16 *)regs->pc;
for (i = -8; i < 16; i++) {
if (get_user(c, cp + i) && i >= 0) {
printk(" Bad PC value.");
break;
}
printk(i ? " %04x" : " <%04x>", c);
}
set_fs(old_fs);
printk ("\n");
}
......@@ -1190,19 +1212,7 @@ void die_if_kernel (char *str, struct pt_regs *fp, int nr)
console_verbose();
printk("%s: %08x\n",str,nr);
print_modules();
printk("PC: [<%08lx>]",fp->pc);
print_symbol(" %s\n", fp->pc);
printk("\nSR: %04x SP: %p a2: %08lx\n",
fp->sr, fp, fp->a2);
printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
fp->d0, fp->d1, fp->d2, fp->d3);
printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
fp->d4, fp->d5, fp->a0, fp->a1);
printk("Process %s (pid: %d, stackpage=%08lx)\n",
current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
show_stack(NULL, (unsigned long *)fp);
show_registers(fp);
do_exit(SIGSEGV);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册