welcome: please sign in

No pages like "Debugging"!

Clear message
location: Debugging

1. Debugging with GDB

To debug things like segfaults, which arise from XULRunner, you can run Conkeror in GDB. To do this effectively, you should install a version of XULRunner that has debugging symbols built in. For example, on Debian, use the package 'xulrunner-8.0-dbg' (substituting 8.0 for whatever version). Launch gdb/Conkeror with a shell script like the following.

LD_LIBRARY_PATH=/path/to/xulrunner-dir \
    exec gdb --args /path/to/xulrunner-dir/xulrunner-bin \
            /path/to/conkeror/application.ini "$@"

At the gdb prompt, enter 'run':

(gdb) run

When the segfault occurs, get a backtrace with the bt command. Refer to gdb documentation for further information on how to use gdb.

2. Debugging with Firefox Remote Debugging

The remote debugger in Firefox can be used to set breakpoints and step through code either on a web page or in Conkeror itself. It can also be used to inspect page elements and view network traffic. It can serve as a replacement for Firebug and Firebug Lite. I did have trouble with the inspector in a version less than Firefox 29, so you might want to have the latest version of Firefox and Xulrunner.

The documentation for Firefox Remote Debugging is at https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging . Unfortunately there's not a page specifically for Xulrunner or Firefox instances, but the page for Thunderbird might be helpful.

First, enable remote debugging in Firefox: 'Open the Toolbox, click the "Settings" button in the toolbar, and check "Enable remote debugging" in the Settings tab.'

Next, enable remote debugging in Conkeror by adding this to your ConkerorRC file:

user_pref("devtools.debugger.remote-enabled", true);

function start_debugging_server () {
                if (!DebuggerServer.initialized) {

            "Starts the debugging server that you can connect to with Firefox",

Next, restart Conkeror and start the debugging server with M-x start-debugging-server.

Finally, connect to Conkeror from Firefox. There are two ways to do this. One is to run "firefox -chrome chrome://browser/content/devtools/connect.xhtml". Another is to start Firefox, click Toolbox > Developer > Connect. You shouldn't need to change any of the settings, click "Connect". A popup should appear from the Conkeror window asking for permission, click "OK". Now a list of processes should appear in Firefox, click on "Main Process." Success, you're now remotely debugging Conkeror!