android - Native code - how to get function call stack (backtrace) programmatically -
i have c++ codebase running on android, , want have crash reports sent users.
i'm using acra library works fine java code, when crashes in native code, don't enough information. i'd receive stack trace of native function calls. know crash info printed logcat after process ends, , can configure acra read/send logcat. i've setup code detect native crash using signal handlers , calling java reporting acra. works fine.
however there's bad timing approach - acra reads logs while crashing process still alive, , android (don't know part) writes crash report logcat after crashed process ends. don't receive stack traces when using acra.
so i'm looking way programatically read current stack trace c++ code, , feed info acra (or maybe other crash reporting tool) myself.
all need kind of report written logcat:
10-10 08:29:13.868: info/debug(1121): #00 pc 0003fc7c /data/data/com.ex.lib/libapp.so 10-10 08:29:13.891: info/debug(1121): #04 pc 00016df4 /system/lib/libdvm.so 10-10 08:29:13.891: info/debug(1121): #05 pc 00045284 /system/lib/libdvm.so 10-10 08:29:13.899: info/debug(1121): #15 pc 00047c56 /system/lib/libdvm.so 10-10 08:29:13.922: info/debug(1121): #16 pc 00030e4c /system/lib/libandroid_runtime.so
is there way stack trace code?
i have done in game base project - can see jni code handles here:
https://bitbucket.org/xg/android-game-base/src/c0d969d44a55/jni/nativeactivityjni.cpp#cl-40
which calls java method defined here:
the overall solution based on handling signals, in signal handler firing call java dump stack trace etc, in code start activity logcat information , email me.
Comments
Post a Comment