How to get stack trace on native level in Android at runtime programmatically

I am developing an android project that uses a lot of JNI to interact with the application’s native code to run it.

Many times, it happens that some of the code in my own application crashes, stopping the java application. I introduced a signal handler at least to catch any segments, or something like that happens in my own layer, and accordingly informed the java level to gracefully and cleanly shut down the whole application so that it works the next time it starts fine.

Now I have reached the stage where I still have accidents in my native layer, but logcat is not enough now to debug where and why this happens.

Can someone help me on how I can capture a stack trace while processing segments / signals of my own application? Native code compiled using the Android NDK toolchain and linked in apk using ant.

I desperately need a way to find out what is going on in my native layer.

Thanks.

+4
source share
1 answer

All Articles