Here is a simple sample for how to use the gdb(server/client) tool to debug the bluez daemon process in android environment.
1. On Device
- # ps <- To find the bluetoothd pid
- # gdbserver :5039 --attach $(bluetoothd pid) &
2. On Host
- # cd $(Android SMDK PATH)
- # adb kill-server
- # adb forward tcp:5039 tcp:5039
- # prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-gdb out/target/product/smdkc110/system/bin/bluetoothd
- $gdb set solib-absolute-prefix $(Android SMDK PATH)/out/target/product/smdkc110/symbols
- $gdb set solib-search-path $(Android SMDK PATH)/out/target/product/smdkc110/symbols/system/lib$:(Android SMDK PATH)/out/target/product/smdkc110/symbols/system/lib/bluez-plugin
- $gdb target remote :5039
- $gdb b bionic/libc/unistd/abort.c:69
- $gdb c
- $gdb bt