linux-mips
[Top] [All Lists]

Re: [PATCH 1/1] Pendantic stack backtrace code

To: linux-mips@linux-mips.org
Subject: Re: [PATCH 1/1] Pendantic stack backtrace code
From: Ola Liljedahl <ola.liljedahl@gmail.com>
Date: Wed, 19 Sep 2012 14:52:02 +0000 (UTC)
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <20110706233614.GA19332@dvomlehn-lnx2.corp.sa.net> <20110802155759.GA891@linux-mips.org> <20110805020242.GA23916@dvomlehn-lnx2.corp.sa.net>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Loom/3.14 (http://gmane.org/)
I have also written a back-trace utility for MIPS, for Enea's "OSE" realtime OS.
Again, it was the sentences in "See MIPS Run" which inspired me (well the whole
book is full of inspiration, a great read). My twist to the solution is that my
design always scans instructions in the *forward* direction (from the specified
PC), trying to find the end of the function. In the process of doing so,
unconditional jumps are followed and conditional branches are followed both
ways. There is however no support for tracing over signal handlers since in the
OSE error handler, we will get the user space register dump for most exceptions
and can start back-tracing there.

The code is available here: https://dl.dropbox.com/u/45566557/mips_backtrace.c

Improvement suggestions and other comments are welcome.

-- Ola Liljedahl



<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 1/1] Pendantic stack backtrace code, Ola Liljedahl <=