Tuesday 12 April 2011

ANDROID DEBUGGING

PROCEDURE TO CONNECT  GDB CLIENT AND SERVER
RUN THIS COMMAND ON THE DEVICE
COMMAND:

gdbserver :5039 /system/bin/executable
EX:gdbserver :5039 /system/bin/bluetoothd
ON THE HOST MACHINE FORWARD PORT 5039 TO DEVICE WITH ADB

COMMAND:adb forward tcp:5039 tcp:5039
TRY STARTING SPECIAL VERSION OF GDB IN THE PATH "prebuilt" area of the source tree

COMMAND:prebuilt/Linux/
toolchain-eabi-4.2.1/bin/arm-eabi-gdb
RUN FIND IN YOUR SOURCE TREE

COMMAND:
prebuilt -name arm-eabi-gdb
SPECIFY THE PATH FOR REFERENCE

COMMAND:prebuilt/Linux/toolchain-eabi-4.2.1/bin/arm-eabi-gdb  out/target/product/product-name/symbols/system/bin/executable
IN GDB,SPECIFY WHERE TO FIND THE SHARED LIBRARIES THAT WILL GET LOADED:

COMMAND:set solib-absolute-prefix /absolute-source-path/out/target/product/product-name/symbols
set solib-search-path /absolute-source-path/out/target/product/product-name/symbols/system/lib

EX:set solib-absolute-prefix /home/parthiban/mydroid//out/target/product/generic/symbols
set solib-search-path /home/parthiban/out/target/product/generic/symbols/system/lib
absolute-source-path is the path to your source tree; for example, /work/device or /Users/hoser/android/device.
product-name is the same as above; for example, sooner.
CONNECT TO DEVICE BY ISSUING THE GDB COMMAND:
target remote :5039
ALLOW SHARED
COMMAND:
shared

PLEASE POST YOUR DOUBTS AND COMMENTS

No comments:

Post a Comment