How to get C++ backtrace on Android
Asked Answered
M

1

2

I am developing a game on android using native C++ and NDK(with eclipse) to build it. I found very difficult to debug the native c++ code with eclipse and NDK when it hits a crash, is there any way to get C++ backtrace when programe crashes ? Please advise.

Meantime answered 18/12, 2012 at 0:33 Comment(0)
F
2

You can do that with ndk-stack executable that is located in root of NDK. Read the docs about it in docs/NDK-STACK.html file.

Fayre answered 18/12, 2012 at 0:36 Comment(3)
Thanks for a prompt reply. Much appreciated.Meantime
One more thing...ndk-stack depends on log-cat output. Thought a few times logcat itself doesn't have any trace, for example it just print.".Fatal signal 11 (SIGSEGV) at 0x00db9e58 (code=2)". How to get backtrace in this condition.Meantime
Ignore last query. I found a way to get complete logcat. if i run the "adb logcat" through shell then i get the complete logs and input the same to ndk-stack generator to see a readable backtrace. Thanks for all your help. This really helps me a lot :-) ..you rock buddyMeantime

© 2022 - 2024 — McMap. All rights reserved.