linux-mips
[Top] [All Lists]

[PATCH 6/7] Fix dump_stack()

To: anemo@mba.ocn.ne.jp
Subject: [PATCH 6/7] Fix dump_stack()
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
Date: Tue, 1 Aug 2006 11:27:16 +0200
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, Franck Bui-Huu <vagabon.xyz@gmail.com>
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=PDwvOdAg5EJLCVDJjq4rGJXjQT8s5W6ljylUggLkZ5dFg3oWLW2cuIwMuZ0nPHSEigWGOx1d8hccJXx+Yci5rMGTz4VA3fBVVIzZ7bwvfUxGicUMEkR9S4+dOSMIyutowxLcENnbEi1L4o+R7FITk2cHRJnmZ/XHHgk7mmbtUzc=
In-reply-to: <11544244373398-git-send-email-vagabon.xyz@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <11544244373398-git-send-email-vagabon.xyz@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
When CONFIG_KALLSYMS is not set stack local is not initialized. Therefore
show_trace() won't display anything useful. This patch uses
prepare_frametrace() to setup the stack pointer before calling
show_trace().

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
---
 arch/mips/kernel/traps.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 15fa445..07191a6 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -203,17 +203,10 @@ void show_stack(struct task_struct *task
  */
 void dump_stack(void)
 {
-       unsigned long stack;
+       struct pt_regs regs;
 
-#ifdef CONFIG_KALLSYMS
-       if (!raw_show_trace) {
-               struct pt_regs regs;
-               prepare_frametrace(&regs);
-               show_backtrace(current, &regs);
-               return;
-       }
-#endif
-       show_trace(&stack);
+       prepare_frametrace(&regs);
+       show_backtrace(current, &regs);
 }
 
 EXPORT_SYMBOL(dump_stack);
-- 
1.4.2.rc2


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