Stacktrace for C on Android

让人想犯罪 __ 提交于 2019-12-09 19:00:56

问题


I have C code in my Android app and would like to catch crashes and print them to a log file. I saw this post, and tried, but I can't find the execinfo lib. I'm working with Ubuntu 11.10 and using NDK for compiling to Android. Does anyone know how to find execinfo lib for NDK/ARM, or have another simple solution?


回答1:


On Android, you have some sample specials utils code allowing to see and/or dump the stack.

Implementation is in base/libs/utils/CallStack.cpp. You'll a find a tiny sample code here.



来源:https://stackoverflow.com/questions/9172945/stacktrace-for-c-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!