Extending Fennec GDB (JimDB) to cover B2G

28 views
Skip to first unread message

Jim Chen

unread,
Jun 10, 2013, 5:05:39 PM6/10/13
to dev...@lists.mozilla.org
Hi all,

I help maintain JimDB, the fork of GDB used by the Fennec team, and I'd
like some feedback on extending JimDB to support debugging B2G.

As a GDB fork, JimDB includes additional bug fixes and improvements over
the GDB included in the Android toolchain (which is the GDB included in
B2G). It also incorporates a set of Python scripts that automates most
of the setup. For example, you can start debugging a Mochitest in one
step, by simply specifying which test and optionally what environment
variables to use.

Here are some more information on JimDB's capabilities,
https://wiki.mozilla.org/Android/GDB and
http://www.jnchen.com/blog/2013/03/updated-jimdb

I think a lot of JimDB's features are applicable to B2G as well, and
through Python scripts, it can potentially do more than what the current
shell script setup is capable of. For example, the script can look for
apps running on your device, ask which app to debug, and automate the rest.

However I'm not a B2G developer, so I'd like some feedback on whether
it's worthwhile to work on this project. Do you use GDB in your
workflow? Is the current GDB setup good enough? What would you like to
be easier when debugging? Thanks for any comments! :)

Cheers,
Jim

Doug Turner

unread,
Jun 10, 2013, 6:03:44 PM6/10/13
to Jim Chen, dev...@lists.mozilla.org
ftr, Jim didn't name this gdb port after himself. Brad Lassey did. You
are welcome, Jim.

Doug Turner

unread,
Jun 10, 2013, 6:03:44 PM6/10/13
to Jim Chen, dev...@lists.mozilla.org
ftr, Jim didn't name this gdb port after himself. Brad Lassey did. You
are welcome, Jim.


Jim Chen wrote:

Doug Turner

unread,
Jun 10, 2013, 6:03:44 PM6/10/13
to Jim Chen, dev...@lists.mozilla.org
ftr, Jim didn't name this gdb port after himself. Brad Lassey did. You
are welcome, Jim.


Jim Chen wrote:

Dave Hylands

unread,
Jun 10, 2013, 8:40:58 PM6/10/13
to Jim Chen, dev...@lists.mozilla.org
Hi Jim,
We (the guys that work on platform stuff on b2g) definitely use gdb.

B2G has a script, run-gdb.sh (which can be symlinked to run-ddd.sh to use the ddd debugger as a front-end UI).
https://github.com/mozilla-b2g/B2G/blob/master/run-gdb.sh
This happens to be written in bash, but I don't think that anybody is averse to using python.

There are a few things that I think B2G probably does differently from android. We use electrolysis, so each app runs in a separate child process. We currently use a script called b2g-ps (run on the phone) to determine the pid associated with each app.

We have the ability to attach to a running process. I think that most people use this technique (launch the app, determine the pid, run-gdb.sh attach PID). If we need to debug app startup, there are a couple of other techniques that can be used.

So, yeah anything that can improve this is most welcome. The ability to debug tests sounds really cool.

Dave Hylands

Michael Wu

unread,
Jun 18, 2013, 11:15:28 PM6/18/13
to Jim Chen, dev...@lists.mozilla.org
Hi Jim,

As Dave Hylands mentioned, gdb is actually relatively simple to use on B2G. It's one of the things that comes standard with every B2G source tree along with some simple wrapper scripts to take care of all the adb forwarding and gdbserver magic.

We can improve on it for sure, and I'll be looking into improving the interface for 1.2 (including many of the features you mentioned). 1.2 also comes with a better GDB that supports python, so I'm not sure we actually need a different gdb binary. The interesting parts will be in scripts that get loaded with gdb.

Thanks,
-Michael Wu
> Cheers,
> Jim
>
> _______________________________________________
> dev-b2g mailing list
> dev...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-b2g
>
Reply all
Reply to author
Forward
0 new messages