$ adb shell root@hammerhead:/ # ps | grep bluetooth bluetooth 9134 2265 907552 46368 sys_epoll_ b6ce9894 S com.android.bluetooth root@hammerhead:/ # gdbserver :1234 --attach 9134 Attached; pid = 9134 Listening on port 1234
另一个终端:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
$ cd Android6.0.1_r20 $ source build/envsetup.h $ lunch 19 $ adb forward tcp:1234 tcp:1234 $ gdbclient 9134 (gdb) target remote :1234 Remote debugging using :1234 warning: Could not load shared library symbols for 9 libraries, e.g. /data/dalvik-cache/arm/system@framework@boot.oat. Use the "info sharedlibrary" command to see the complete listing. Do you need "set solib-search-path" or "set sysroot"? Reading symbols from /home/fanrong/Computer/Android6.0.1-r20/out/target/product/hammerhead/symbols/system/bin/linker...done. Loaded symbols for /home/fanrong/Computer/Android6.0.1-r20/out/target/product/hammerhead/symbols/system/bin/linker Reading symbols from /home/fanrong/Computer/Android6.0.1-r20/out/target/product/hammerhead/symbols/system/lib/libcutils.so...done. Loaded symbols for /home/fanrong/Computer/Android6.0.1-r20/out/target/product/hammerhead/symbols/system/lib/libcutils.so ... Loaded symbols for /home/fanrong/Computer/Android6.0.1-r20/out/target/product/hammerhead/symbols/system/vendor/lib/libbt-vendor.so __epoll_pwait () at bionic/libc/arch-arm/syscalls/__epoll_pwait.S:16 16 ldmfd sp!, {r4, r5, r6, r7} (gdb)