Date: Thu, 30 Jul 2009 16:50:22 -0700 From: Oleksandr Tymoshenko <gonzo@freebsd.org> To: Neelkanth Natu <neelnatu@yahoo.com> Cc: freebsd-mips@freebsd.org Subject: Re: Diffs to fix ddb backtrace Message-ID: <4A7231BE.3090703@freebsd.org> In-Reply-To: <681122.20462.qm@web34407.mail.mud.yahoo.com> References: <681122.20462.qm@web34407.mail.mud.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Neelkanth Natu wrote:
> Hi,
>
> This diff fixes a problem I encountered with ddb backtrace.
>
> The problem with looking for just 'j ra' instruction to find out the
> end of the previous function is that gcc does not emit that
> instruction for functions that are not supposed to return (for e.g.
> boot() or panic()). This is especially bad because the backtrace
> generated by calling panic() is unusable because boot() is right
> above panic() in the object file.
>
> This change looks for start of a function by looking for an instruction
> of the form: addiu sp,sp,-<frame_size>
>
> It so happens that gcc emits this as the first instruction for all
> functions that use the stack. We keep the 'j ra' method around for
> functions that don't use the stack.
Thanks! This is something I've always wanted to do but never did
:) commited to projects/mips
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A7231BE.3090703>
