User:MarkFinkle/MaemoDebugging

From MozillaWiki
Jump to navigation Jump to search

I had no previous development experience on Linux before working on Fennec. However, we use the tools we have, so I started playing with gdb and gdbserver.

To debug Fennec/XULRunner, you'll need a build with at least debug symbols. Creating full debug builds in scratchbox has failed many times. Using debug symbols is a little more lightweight.

Add the following to you mozconfig:

export MOZ_DEBUG_SYMBOLS=1
ac_add_options --enable-debugger-info-modules=yes

Now the Fennec/XULRunner binaries have debug symbols. However, the packaging phase will strip the symbols. You need to disable the strip.

In mozconfig:

ac_add_options --disable-install-strip

During a package:

make package PKG_SKIP_STRIP=1 

Now you can copy the binaries to the device. Because the debug binaries are larger than the release versions, you probably want to copy the application to /media/mmc2 since it has much more space available:

scp fennec-archive.tar.bz2 root@192.168.10.100:/media/mmc2

In order to use gdb or gdbserver on the device, you'll need to install it:

apt-get install gdb

gdbserver host:5555 ./fennec

gdb gdb target remote 192.168.10.103:5555 continue