Diffs to fix ddb backtrace

Oleksandr Tymoshenko gonzo at freebsd.org
Thu Jul 30 23:50:30 UTC 2009


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


More information about the freebsd-mips mailing list