[xtensa-cvscommit] linux/arch/xtensa/kernel traps.c,1.14,1.15
Brought to you by:
zankel
|
From: <joe...@us...> - 2003-06-12 23:44:26
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv11282/arch/xtensa/kernel
Modified Files:
traps.c
Log Message:
Improve error formatting.
Index: traps.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/traps.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** traps.c 10 Jun 2003 20:18:49 -0000 1.14
--- traps.c 12 Jun 2003 23:44:23 -0000 1.15
***************
*** 587,591 ****
i = 0;
! printk("Stack (at %08x):", (int) stack);
while ((unsigned long) stack & (PAGE_SIZE - 1)) {
unsigned long stackdata;
--- 587,591 ----
i = 0;
! printk("Stack (at %08x):\n ", (int) stack);
while ((unsigned long) stack & (PAGE_SIZE - 1)) {
unsigned long stackdata;
***************
*** 608,665 ****
}
- /*
- * This constant is for searching for possible module text segments.
- * MODULE_RANGE is a guess of how much space is likely to be vmalloced.
- */
- #define MODULE_RANGE (8*1024*1024)
-
void show_trace(unsigned int *sp)
{
! int i;
! unsigned int *stack;
! unsigned long kernel_start, kernel_end;
! unsigned long module_start, module_end;
! extern char _stext, _etext;
!
! stack = sp;
! i = 0;
!
! kernel_start = (unsigned long) &_stext;
! kernel_end = (unsigned long) &_etext;
! module_start = VMALLOC_START;
! module_end = module_start + MODULE_RANGE;
!
! /* XTFIXME: Cool idea, but the code is wrong for the Xtensa
! architecture. If we encounter this, we can fix it. */
!
! printk("\nCall Trace (this data is wrong):");
!
! while ((unsigned long) stack & (PAGE_SIZE -1)) {
! unsigned long addr;
!
! if (__get_user(addr, stack++)) {
! printk(" (Bad stack address)\n");
! break;
! }
!
! /*
! * If the address is either in the text segment of the
! * kernel, or in the region which contains vmalloc'ed
! * memory, it *may* be the address of a calling
! * routine; if so, print it so that someone tracing
! * down the cause of the crash will be able to figure
! * out the call path that was taken.
! */
!
! if ((addr >= kernel_start && addr < kernel_end) ||
! (addr >= module_start && addr < module_end)) {
! printk(" [<%08lx>]", addr);
! if (++i > 40) {
! printk(" ...");
! break;
! }
! }
! }
}
--- 608,624 ----
}
void show_trace(unsigned int *sp)
{
! /* XTFIXME: This is supposed to be a generic show backtrace
! function, but there are many complications on Xtensa that
! we just haven't implemented yet. The main one is spilling
! live window registers before backtracing the stack. How to
! do it for a user task whose registers haven't been spilled?
! Possible example in
! <glibc/sysdeps/unix/sysv/linux/xtensa/segfault.c>. Another
! issue is the window-size bits of the return addresses.
! */
! printk("\nCall backtrace: (NOT YET IMPLEMENTED)");
}
|