From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: [PATCH 2 of 3] To help debug stack overflows, debug backtrace now shows Date: Thu, 03 Dec 2009 18:50:02 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: keir.fraser@eu.citrix.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User konrad@phenom.dumpdata.com # 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 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];