[PD] backtrace() for MinGW (and Android)

Hans-Christoph Steiner hans at at.or.at
Sun Feb 12 17:10:59 CET 2012


On Feb 12, 2012, at 11:09 AM, Mathieu Bouchard wrote:

> Le 2012-02-12 à 10:41:00, Hans-Christoph Steiner a écrit :
>> On Feb 12, 2012, at 12:43 AM, Mathieu Bouchard wrote:
>>> Does anyone have such a thing for Android ?
>>> I found something similar, except it doesn't work inside a signal handler, so, unlike any other Linux OS, I can't get backtrace() to give me the stack of a segfault.
>> 
>> That's probably because backtrace() is not Linux but GNU, and Android is Linux but not GNU.  It uses its own "Bionic" libc, for example.
> 
> Yeah, I already know that part. The question is more about how to do it on Android. The native functions can't seem to go through the signal boundary, so they give a backtrace of 4 functions in my Android app when the app crashed inside of 50 nested functions, for example. The 4th stack frame looks like it's the end of the stack, and I need a way to access the 5th stack frame from there, and then I'd be able to access the 49 other frames. But it seems that even if I had a magical way of finding where the 5th frame is, Android's function would not allow me to tell it where to go.

Its not the same thing, but the 'log' library allows you to log all kinds of messages to the logcat, which you can watch live in the DDMS view in Eclipse.

.hc

----------------------------------------------------------------------------

Terrorism is not an enemy.  It cannot be defeated.  It's a tactic.  It's about as sensible to say we declare war on night attacks and expect we're going to win that war.  We're not going to win the war on terrorism.        - retired U.S. Army general, William Odom





More information about the Pd-list mailing list