[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2 of 3] To help debug stack overflows, debug backtrace now shows



# HG changeset patch
# User konrad@xxxxxxxxxxxxxxxxxxx
# Date 1259769725 18000
# Node ID ea7fc895409dbaf507da807b3473431e6586a907
# Parent  f9eeb0545e1c48cd9fc090c3be8d994b258dd636
To help debug stack overflows, debug backtrace now shows
stack pointer values and stack limits.

Authored-by: David Lively
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

diff -r f9eeb0545e1c -r ea7fc895409d xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Wed Dec 02 10:57:18 2009 -0500
+++ b/xen/arch/x86/traps.c      Wed Dec 02 11:02:05 2009 -0500
@@ -239,18 +239,25 @@
 {
     unsigned long *frame, next, addr, low, high;
 
-    printk("Xen call trace:\n   ");
-
-    printk("[<%p>]", _p(regs->eip));
-    print_symbol(" %s\n   ", regs->eip);
+    printk("Xen call trace:\n");
 
     /* Bounds for range of valid frame pointer. */
     low  = (unsigned long)(ESP_BEFORE_EXCEPTION(regs) - 2);
     high = (low & ~(STACK_SIZE - 1)) + 
         (STACK_SIZE - sizeof(struct cpu_info) - 2*sizeof(unsigned long));
 
+    {
+        unsigned long bos, los;
+        bos = (low & ~(STACK_SIZE - 1)) + STACK_SIZE;
+        los = bos - PAGE_SIZE;
+        printk("Stack base:%p limit:%p\n   ", _p(bos), _p(los));
+    }
+    
     /* The initial frame pointer. */
     next = regs->ebp;
+    
+    printk("%p[<%p>]", _p(next), _p(regs->eip));
+    print_symbol(" %s\n   ", regs->eip);
 
     for ( ; ; )
     {
@@ -278,7 +285,7 @@
             addr  = frame[1];
         }
 
-        printk("[<%p>]", _p(addr));
+        printk("%p[<%p>]", _p(next), _p(addr));
         print_symbol(" %s\n   ", addr);
 
         low = (unsigned long)&frame[2];



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.