꿈소년의 개발 이야기

ndk-stack 으로 so 파일 debugging 하기 본문

Android Development

ndk-stack 으로 so 파일 debugging 하기

꿈소년 2013. 5. 13. 23:10
반응형
refer to : http://yssays.wordpress.com/2011/12/27/android-ndk-stack-tool/
https://code.google.com/p/android-ndk-stacktrace-analyzer/wiki/Usage
http://www.codexperiments.com/android/2010/08/tips-tricks-debugging-android-ndk-stack-traces/

 android ndk 내에 ndk-stack 이 있다. 


라이브러리에서 생긴 문제가 되는 라인이 어딘지 찾아낸다.


1)  adb logcat |  ndk-stack -sym <Path to  your shared libraries>

2)  ndk-stack -sym <Path to  your shared libraries> -dump <file name containing the  crash logs>

Usage:

------

To do this, you will first need a directory containing symbolic versions of your

application's shared libraries. If you use the NDK build system (i.e. ndk-build),

then these are always located under $PROJECT_PATH/obj/local/&lt;ab&gt;, where

&lt;ab&gt; stands for your device's ABI (i.e. 'armeabi' by default).

You can feed the logcat text either as direct input to the program, e.g.:

   adb logcat | $NDK/ndk-stack -sym $PROJECT_PATH/obj/local/armeabi

Or you can use the -dump option to specify the logcat as an input file, e.g.:

   adb logcat &gt; /tmp/foo.txt


   $NDK/ndk-stack -sym $PROJECT_PATH/obj/local/armeabi -dump foo.txt



추가적으로 tomstone 파일과 합쳐서 보기


cat <tombstone 파일> | ndk-stack sym /out/target/product/generic/symbols/system/lib >> symbol.txt