r1668

stsp at user.in-berlin.de stsp at user.in-berlin.de
Sat Dec 23 23:23:29 CET 2006


Author: stsp
Date: 2006-12-23 23:23:24 +0100 (Sat, 23 Dec 2006)
New Revision: 1668

Log:
Print pseudo stack trace on data aborts.


Modified:
   trunk/linux-2.6.x/arch/arm/mm/fault.c

Modified: trunk/linux-2.6.x/arch/arm/mm/fault.c
===================================================================
--- trunk/linux-2.6.x/arch/arm/mm/fault.c	2006-12-23 16:16:27 UTC (rev 1667)
+++ trunk/linux-2.6.x/arch/arm/mm/fault.c	2006-12-23 22:23:24 UTC (rev 1668)
@@ -462,11 +462,28 @@
 do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 {
 	struct siginfo info;
+	unsigned long *p;
+	unsigned int i;
 
 	printk(KERN_ALERT "Data abort: pc=0x%08lx\n", regs->ARM_pc);
 	printk(KERN_ALERT "            lr=0x%08lx\n", regs->ARM_lr);
+	printk(KERN_ALERT "            sp=0x%08lx\n", regs->ARM_sp);
+#if 0
+	/* This value is always garbage. I think Pepsiman once said
+	 * that the MPU does not provide the faulty address at all... */
 	printk(KERN_ALERT "          addr=0x%08lx\n", addr);
+#endif
 
+	/* Get the best possible stack trace.
+	 * Print all addresses on the stack that are inside the
+	 * text segment of the current process, i.e. probably functions... */
+	printk(KERN_ALERT "Possible stack trace:\n");
+	i = 1;
+	for (p = (unsigned long*)regs->ARM_sp; !kstack_end(p); p++) {
+		if (current->mm->start_code < *p && *p < current->mm->end_code)
+			printk("%02i: %08lx\n", i++, *p);
+	}
+
 	info.si_signo = SIGKILL;
 	info.si_errno = 0;
 	info.si_code  = 0;




More information about the dslinux-commit mailing list