show_trace((unsigned long *)tsk->thread.esp0);
}
-static void dump_stack(struct frame *fp)
+void show_registers(struct pt_regs *regs)
{
- unsigned long *stack, *endstack, addr;
+ struct frame *fp = (struct frame *)regs;
+ unsigned long addr;
int i;
addr = (unsigned long)&fp->un;
default:
printk("\n");
}
+ show_stack((unsigned long *)addr);
+
+ printk("Code: ");
+ for (i = 0; i < 10; i++)
+ printk("%04x ", 0xffff & ((short *) fp->ptregs.pc)[i]);
+ printk ("\n");
+}
+
+extern void show_stack(unsigned long *stack)
+{
+ unsigned long *endstack;
+ int i;
- stack = (unsigned long *)addr;
- endstack = (unsigned long *)((addr + THREAD_SIZE - 1) & -THREAD_SIZE);
+ if (!stack)
+ stack = (unsigned long *)&stack;
+ endstack = (unsigned long *)(((unsigned long)stack + THREAD_SIZE - 1) & -THREAD_SIZE);
printk("Stack from %08lx:", (unsigned long)stack);
for (i = 0; i < kstack_depth_to_print; i++) {
printk(" %08lx", *stack++);
}
printk("\n");
- show_trace((unsigned long *)addr);
+ show_trace(stack);
+}
- printk("Code: ");
- for (i = 0; i < 10; i++)
- printk("%04x ", 0xffff & ((short *) fp->ptregs.pc)[i]);
- printk ("\n");
+/*
+ * The architecture-independent backtrace generator
+ */
+void dump_stack(void)
+{
+ unsigned long stack;
+
+ show_trace(&stack);
}
void bad_super_trap (struct frame *fp)
printk("Process %s (pid: %d, stackpage=%08lx)\n",
current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
- dump_stack((struct frame *)fp);
+ show_stack((unsigned long *)fp);
do_exit(SIGSEGV);
}