ndk-gdb testing
Setup steps
- Sync the Android.mk samples with
git clone -b android-mk https://github.com/googlesamples/android-ndk.git
- Pick a sample app (e.g. Teapot), cd into its directory, and compile and install it to a device with
android update project -p . --target <target> && ndk-build && ant clean debug install
, where <target>
is an SDK target such as android-23
. - Run ndk-gdb.py. This can be done in three ways:
- Launch the application, and then run
ndk-gdb
from the app directory to attach the debugger. - Run
ndk-gdb --launch
to have ndk-gdb start the application's main activity. - Run
ndk-gdb --launch-activity <activity name>
to have ndk-gdb start a specific activity.
- Test things!
Relevant things to test
- Verify that backtraces are sensible.
- Verify that breakpoints set before and after library load both work. (Using --launch vs. attaching after the application is running helps here.)
- Verify that C++ stdlib pretty printers work (stlport and gnustl only).
- Verify that ndk-gdb works with all valid combinations of app ABI support (defined in
APP_ABI
in Application.mk) and device ABI support. For example, test with the following combinations:- 32-bit device:
APP_ABI := armeabi
APP_ABI := armeabi arm64-v8a
- 64-bit device:
APP_ABI := armeabi
APP_ABI := armeabi arm64-v8a
APP_ABI := arm64-v8a