WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2 of 3] To help debug stack overflows, debug backtrac

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2 of 3] To help debug stack overflows, debug backtrace now shows
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Thu, 03 Dec 2009 18:50:02 -0000
Cc: keir.fraser@xxxxxxxxxxxxx
Delivery-date: Thu, 03 Dec 2009 10:59:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1259866200@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1259866200@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.3
# 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

<Prev in Thread] Current Thread [Next in Thread>