Your Search Results

    Debugging Mozilla with lldb

    LLDB warning: Xcode 5 only comes with lldb (gdb is gone). The introduction and use of UNIFIED_SOURCES in the source starting around November 2013 has broken the default LLDB configuration so that it will not manage to resolve breakpoints in files that are build using UNIFIED_SOURCES (the breakpoints will be listed as "pending", and lldb will not stop at them). To fix this add the following to your $HOME/.lldbinit file:

    # Mozilla's use of UNIFIED_SOURCES to include multiple source files into a
    # single compiled file breaks lldb breakpoint setting. This works around that.
    # See http://lldb.llvm.org/troubleshooting.html for more.
    settings set target.inline-breakpoint-strategy always
    

    Restart Xcode/lldb and restart your debugging session. If that still doesn't fix things then try closing Xcode/lldb, doing a clobber build, reopening Xcode/lldb, and restarting your debugging session.

    See http://lldb.llvm.org/index.html

    Starting a debugging session

    Attaching to an existing process

    You can attach to Firefox with following command:

    (lldb) process attach --name firefox
    

    Some versions of lldb causes crashes after attaching to Firefox.

    Running a new process

    To start Firefox under the debugger, run lldb followed by "--", followed by the command line you'd like to run, like this:

    $ lldb -- obj-ff-dbg/dist/Nightly.app/Contents/MacOS/firefox-bin -no-remote -profile /path/to/profile

    Then set breakpoints you need and start the process:

    (lldb) breakpoint set --name nsInProcessTabChildGlobal::InitTabChildGlobal
    Breakpoint created: 1: name = 'nsInProcessTabChildGlobal::InitTabChildGlobal', locations = 0 (pending)
    WARNING:  Unable to resolve breakpoint to any actual locations.
    
    (lldb) r
    Process 7602 launched: '/.../obj-ff-opt/dist/Nightly.app/Contents/MacOS/firefox-bin' (x86_64)
    1 location  added to breakpoint 1
    

    Document Tags and Contributors

    Contributors to this page: Jonathan_Watt, Nickolay, jrmuizel
    Last updated by: Jonathan_Watt,