Friday, October 28, 2011

Android NDK Crash Logs

So there you are working happily with the Android NDK and get a crash. Instead of a handy breakpoint where you can see the state of all the variables, you get something that looks like this:

10-28 15:31:49.333: I/DEBUG(1010): #00 pc 00557718 [heap]

10-28 15:31:49.333: I/DEBUG(1010): #01 pc 000903e6 /data/data/goldenhammer.scribbleworm/lib/libScribbleWormBase.so

10-28 15:31:49.333: I/DEBUG(1010): #02 pc 00072a1a /data/data/goldenhammer.scribbleworm/lib/libScribbleWormBase.so

10-28 15:31:49.333: I/DEBUG(1010): #03 pc 00084222 /data/data/goldenhammer.scribbleworm/lib/libScribbleWormBase.so

10-28 15:31:49.341: I/DEBUG(1010): #04 pc 00096dfa /data/data/goldenhammer.scribbleworm/lib/libScribbleWormBase.so

10-28 15:31:49.341: I/DEBUG(1010): #05 pc 0006d578 /data/data/goldenhammer.scribbleworm/lib/libScribbleWormBase.so

Great! How do I figure out how to turn that into something useful?
~/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-addr2line -C -f -e
~/src/sb/src/AndroidProjects/ScribbleWormLib/jni/libs/armeabi/libScribbleWormBase.so 000903e6
This will spit out something like:
YrgMaterialWarmer::warmMaterials()
??:0
It may be pathetic compared to C++ development on any other platform, but at least that's a starting point to look for problems.

No comments:

Post a Comment