1. On the device, launch a new command:
- gdbserver :5039 /system/bin/executable
or attach to an existing process:
- gdbserver :5039 --attach pid
2. On your workstation, forward port 5039 to the device with adb:
- adb forward tcp:5039 tcp:5039
3. Start a latest version of gdb that lives in the "prebuilt" area of the source tree:
- prebuild/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gdb out/target/product/generic/symbols/system/bin/executable
4. If you can't find either special version of gdb, run find prebuilt -name arm-eabi-gdb in your source tree to find and run the latest version.
5. In gdb, Tell gdb where to find the shared libraries that will get loaded:
- set solib-absolute-prefix /absolute-source-path/out/target/product/generic/symbols
-
set solib-search-path /absolute-source-path/out/target/product/generic/symbols/system/lib
6. Connect to the device by issuing the gdb command:
The :5039 tells gdb to connect to the localhost port 5039, which is bridged to the device by adb.
You may need to inspire gdb to load some symbols by typing:
阅读(1416) | 评论(0) | 转发(0) |