linux-mips
[Top] [All Lists]

Re: [PATCH] Remove mfinfo[64] used by get_wchan()

To: vagabon.xyz@gmail.com
Subject: Re: [PATCH] Remove mfinfo[64] used by get_wchan()
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Fri, 18 Aug 2006 23:04:03 +0900 (JST)
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <44E5AFD9.1050101@innova-card.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <44E57F39.2020009@innova-card.com> <20060818.181136.85412687.nemoto@toshiba-tops.co.jp> <44E5AFD9.1050101@innova-card.com>
Sender: linux-mips-bounce@linux-mips.org
On Fri, 18 Aug 2006 14:17:29 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> 
wrote:
> > Why get_frame_info() will be called with info->func_size != 0 ?  The
> > offset of a _first_ instruction is 0, so "ofs" of this line in
> > unwind_stack() will be 0.
> > 
> >     info.func_size = ofs;   /* analyze from start to ofs */
> > 
> 
> because in unwind_stack(), before the line you showed, we do:
> 
>       if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
>               return 0;
>       if (ofs == 0)
>               return 0;

Oh I missed it.

> Maybe we should do instead:
> 
>       if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
>               return 0;
>       /* return ra if an exception occured at the first instruction */
>       if (ofs == 0)
>               return ra;

Sure.  I should be a right fix.  This part must be fixed anyway.

> And in any cases, if we pass info->func_size = 0 to get_frame_info(),
> then it will consider the function size as unknown.

I see.  You're right.

---
Atsushi Nemoto

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