canmove, Confirmed users, Bureaucrats and Sysops emeriti
2,798
edits
MarkFinkle (talk | contribs) No edit summary |
MarkFinkle (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
I had no previous development experience on Linux before working on Fennec. However, we use the tools we have, so I started playing with <code>gdb</code> and <code>gdbserver</code>. | I had no previous development experience on Linux before working on Fennec. However, we use the tools we have, so I started playing with <code>gdb</code> and <code>gdbserver</code>. | ||
'''Debug Symbols''' | |||
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. | 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. | ||
| Line 9: | Line 10: | ||
</pre> | </pre> | ||
'''Packaging''' | |||
Now the Fennec/XULRunner binaries have debug symbols. However, the packaging phase will strip the symbols. You need to disable the strip. | Now the Fennec/XULRunner binaries have debug symbols. However, the packaging phase will strip the symbols. You need to disable the strip. | ||
| Line 21: | Line 23: | ||
</pre> | </pre> | ||
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: | 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 <code>/media/mmc2</code> since it has much more space available: | ||
<pre> | <pre> | ||
scp fennec-archive.tar.bz2 root@192.168.10.100:/media/mmc2 | scp fennec-archive.tar.bz2 root@192.168.10.100:/media/mmc2 | ||
</pre> | </pre> | ||
'''GDB''' | |||
In order to use <code>gdb</code> or <code>gdbserver</code> on the device, you'll need to install it: | In order to use <code>gdb</code> or <code>gdbserver</code> on the device, you'll need to install it: | ||
<pre> | <pre> | ||
| Line 31: | Line 34: | ||
</pre> | </pre> | ||
Since the debug binaries are on the device, you could use <code>gdb</code> on the device too: | |||
<pre> | |||
gdb ./fennec | |||
</pre> | |||
If you have a core dump file, you can load it too: | |||
<pre> | |||
gdb ./fennec [path/to/coredump] | |||
</pre> | |||
Running <code>gdb</code> on the device may be more pain than you can bear. Loading symbols from <code>libxul.so</code> can cause the device to reboot from OOM. | |||
Instead of running locally, you can try running remotely. You can use <code>gdbserver</code> to run the application on the device and remote back to <code>gdb</code> which is running on your desktop, in scratchbox. | |||
On the device: | |||
<pre> | |||
gdbserver host:5555 ./fennec | gdbserver host:5555 ./fennec | ||
</pre> | |||
gdb | On the desktop: | ||
gdb target remote 192.168.10. | <pre> | ||
continue | > gdb | ||
(gdb) target remote 192.168.10.100:5555 | |||
(gdb) symbol-file /path/to/libxpcom.so | |||
(gdb) symbol-file /path/to/libmozjs.so | |||
(gdb) symbol-file /path/to/libxul.so | |||
(gdb) continue | |||
</pre> | |||