Android: Difference between revisions

Jump to navigation Jump to search
222 bytes added ,  22 March 2010
→‎Attach gdb: update gdb info
(→‎Attach gdb: update gdb info)
Line 182: Line 182:
* Forward a port for gdb between your device and computer using adb. Any port you can open should work. 1234 is used here.
* Forward a port for gdb between your device and computer using adb. Any port you can open should work. 1234 is used here.
** (Host) adb forward tcp:1234 tcp:1234
** (Host) adb forward tcp:1234 tcp:1234
* Find the pid of your process if you don't know it
* Find the pid of your process if you don't know it. Every message in adb logcat specifies the PID of the process that produced the message, so gecko's PID can be found there.
** (Device) ps js
USER    PID   PPID  VSIZE RSS  WCHAN    PC        NAME
root    6036  6034  6084  1856  ffffffff afe0c27c T ./js
* Attach gdbserver to the process
* Attach gdbserver to the process
** (Device) gdbserver localhost:1234 --attach 6036
** (Device) gdbserver localhost:1234 --attach 6036
  Attached; pid = 6036
  Attached; pid = 6036
  Listening on port 1234
  Listening on port 1234
* Run arm-eabi-gdb on your binary. (android-ndk-1.6_r1/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin)
* Run arm-eabi-gdb on your binary. (android-ndk-1.6_r1/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin) For debugging gecko, a copy of app_process from your device should be used.
** (Host) ~/android-ndk-1.6_r1/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin/arm-eabi-gdb js
** (Host) ~/android-ndk-1.6_r1/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin/arm-eabi-gdb app_process
  GNU gdb 6.6
  GNU gdb 6.6
  Copyright (C) 2006 Free Software Foundation, Inc.
  Copyright (C) 2006 Free Software Foundation, Inc.
Line 205: Line 202:
* Connect to gdbserver
* Connect to gdbserver
** (Host gdb) target remote localhost:1234
** (Host gdb) target remote localhost:1234
* These three Host gdb commands can be placed in a .gdbinit file to automate future gdb runs. .gdbinit should be located where you normally run gdb.


== Profiling ==
== Profiling ==
134

edits

Navigation menu