linux-mips
[Top] [All Lists]

[PATCH 1/3] unwind_stack(): return ra if an exception occured at the fir

To: anemo@mba.ocn.ne.jp
Subject: [PATCH 1/3] unwind_stack(): return ra if an exception occured at the first instruction
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
Date: Fri, 18 Aug 2006 16:18:07 +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; b=CaT7xFTO8neVRjf5FZ08JbOzVYqKINdnYvviux52bRKRCTv46uaLPSv0mMBToZJMXGfql/uWQaQmEY92f7SW/XxyPYCUuOLXv2lTFYNW3Na0rDRm676bVFr3AKusggwyFrYPyDRAdqS1Am+B4iqjBReCUA+/XevTradlVCqZbOE=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
---
 arch/mips/kernel/process.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 951bf9c..e7b0b38 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -465,8 +465,11 @@ unsigned long unwind_stack(struct task_s
 
        if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
                return 0;
-       if (ofs == 0)
-               return 0;
+       /*
+        * Return ra if an exception occured at the first instruction
+        */
+       if (unlikely(ofs == 0))
+               return ra;
 
        info.func = (void *)(pc - ofs);
        info.func_size = ofs;   /* analyze from start to ofs */
-- 
1.4.2.rc4


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