kdb
[Top] [All Lists]

[PATCH] fix crash in kdba bt command

To: anton@xxxxxxxxx
Subject: [PATCH] fix crash in kdba bt command
From: linas@xxxxxxxxxxxxxx
Date: Fri, 16 Apr 2004 15:43:20 -0500
Cc: kdb@xxxxxxxxxxx, linuxppc64-dev@xxxxxxxxxxxxxxxxxx, ananth@xxxxxxxxxx, nitin@xxxxxxxxxx
Sender: kdb-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
Anton,

Please apply attached patch to ameslab.  Note, this is just the first,
there will probably be some more patches coming in the next few days.

This patch fixes a minor bug in th backtrace command; bt <addr>
was failing to actually trace the stack at addr.

--linas



-- Attached file included as plaintext by Ecartis --

--- kdba_bt.c.orig      2004-04-16 14:45:44.000000000 -0500
+++ kdba_bt.c   2004-04-16 15:29:42.000000000 -0500
@@ -126,7 +126,7 @@ kdba_bt_stack_ppc(struct pt_regs *regs, 
        if (!addr)
                addr = (kdb_machreg_t *)p->thread.ksp;
 
-       if (addr && !task_curr(p)) {
+       if (addr && (!p || !task_curr(p))) {
                eip = 0;
                esp = *addr;
                ebp = 0;
@@ -183,7 +183,8 @@ kdba_bt_stack_ppc(struct pt_regs *regs, 
                /*              kdbnearsym(eip, &symtab); */
                kdba_find_tb_table(eip, &tbtab); 
 
-               /*              sym = symtab.sym_name ? &symtab : 
&tbtab.symtab; *//* use fake symtab if necessary */
+               /* sym = symtab.sym_name ? &symtab : &tbtab.symtab; */
+               /* use fake symtab if necessary */
                name = NULL;
                if (esp >= PAGE_OFFSET) { 
                        /*if ((sym) )*/ 
@@ -288,8 +289,8 @@ kdba_bt_stack(struct pt_regs *regs, kdb_
 /*
  * kdba_bt_address
  *
- *     Do a backtrace starting at a specified stack address.  Use this if the
- *     heuristics get the i386 stack decode wrong.
+ *     Do a backtrace starting at a specified stack address.  Handy
+ *     if the stack is somwhere unexpected/unusual.
  *
  * Inputs:
  *     addr    Address provided to 'bt' command.
@@ -300,9 +301,6 @@ kdba_bt_stack(struct pt_regs *regs, kdb_
  *     zero for success, a kdb diagnostic if error
  * Locking:
  *     none.
- * Remarks:
- *     mds %esp comes in handy when examining the stack to do a manual
- *     traceback.
  */
 
 int


---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.
<Prev in Thread] Current Thread [Next in Thread>