From: "Jan Beulich" Subject: [PATCH] adjust stack dump Date: Tue, 04 Apr 2006 13:32:04 +0200 Message-ID: <44327554.76F0.0078.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part63461824.0__=" Return-path: 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 List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part63461824.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline With the standard (XEN) prefix and the setting of 8 words per line, stack dumps on i386 came out at 81 characters per line. The change to xen/arch/x86/traps.c makes this 80 (without changing the look on the screen), and the change to xen/drivers/char/console.c arranges for soft line breaks not getting duplicated by hard line breaks, so displaying 80 characters per line doesn't result in a subsequent blank line. Jan --=__Part63461824.0__= Content-Type: text/plain; name="xen-stack-dump.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen-stack-dump.patch" --- /home/jbeulich/src/xen/2006-03-26/xen/arch/x86/traps.c 2006-03-24 17:38:28.000000000 +0100 +++ 2006-03-26/xen/arch/x86/traps.c 2006-04-04 11:59:25.000000000 +0200 @@ -138,13 +138,13 @@ static void show_guest_stack(struct cpu_ if ( vm86_mode(regs) ) { stack = (unsigned long *)((regs->ss << 4) + (regs->esp & 0xffff)); - printk("Guest stack trace from ss:sp = %04x:%04x (VM86)\n ", + printk("Guest stack trace from ss:sp = %04x:%04x (VM86)\n ", regs->ss, (uint16_t)(regs->esp & 0xffff)); } else { stack = (unsigned long *)regs->esp; - printk("Guest stack trace from "__OP"sp=%p:\n ", stack); + printk("Guest stack trace from "__OP"sp=%p:\n ", stack); } for ( i = 0; i < (debug_stack_lines*stack_words_per_line); i++ ) @@ -160,8 +160,8 @@ static void show_guest_stack(struct cpu_ break; } if ( (i != 0) && ((i % stack_words_per_line) == 0) ) - printk("\n "); - printk("%p ", _p(addr)); + printk("\n "); + printk(" %p", _p(addr)); stack++; } if ( i == 0 ) @@ -257,16 +257,16 @@ void show_stack(struct cpu_user_regs *re if ( guest_mode(regs) ) return show_guest_stack(regs); - printk("Xen stack trace from "__OP"sp=%p:\n ", stack); + printk("Xen stack trace from "__OP"sp=%p:\n ", stack); for ( i = 0; i < (debug_stack_lines*stack_words_per_line); i++ ) { if ( ((long)stack & (STACK_SIZE-BYTES_PER_LONG)) == 0 ) break; if ( (i != 0) && ((i % stack_words_per_line) == 0) ) - printk("\n "); + printk("\n "); addr = *stack++; - printk("%p ", _p(addr)); + printk(" %p", _p(addr)); } if ( i == 0 ) printk("Stack empty."); --- /home/jbeulich/src/xen/2006-03-26/xen/drivers/char/console.c 2006-03-15 20:18:41.000000000 +0100 +++ 2006-03-26/xen/drivers/char/console.c 2006-04-04 12:05:33.000000000 +0200 @@ -200,10 +200,11 @@ static void putchar_console(int c) } else { + if ( xpos >= COLUMNS ) + put_newline(); video[(xpos + ypos * COLUMNS) * 2] = c & 0xFF; video[(xpos + ypos * COLUMNS) * 2 + 1] = ATTRIBUTE; - if ( ++xpos >= COLUMNS ) - put_newline(); + ++xpos; } } --=__Part63461824.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part63461824.0__=--