mozilla-b2g/B2G — pull request #50 by mvines (2012-06-27 13:04:56+00:00)
Title: run-gdb.sh child process support, and other improvements

Attach to any PID running on device

|run-gdb.sh |
Launch gdb with /system/a/program (default program is /system/b2g/b2g)

The TCP port used to communicate with gdbserver on device is now computed
dynamically based on the UID of the invoker (permitting multiple users per host
machine) and the PID of the debuggee (permitting multiple gdb sessions per
user).

MOZ_DEBUG_CHILD_PROCESS and MOZ_IPC_MESSAGE_LOG environment variables now
propagated into new gdb sessions to enable convenient child process debugging.
Usage example:
$ MOZ_DEBUG_CHILD_PROCESS=1 run-gdb.sh
(gdb) c

--- watch for this output on stdout ---
CHILDCHILDCHILDCHILD
debug me @1502
---
$ run-gdb.sh attach 1502