mozilla

Revision 359671 of Debugging Mozilla with lldb

  • Revision slug: Debugging_Mozilla_with_lldb
  • Revision title: Debugging Mozilla with lldb
  • Revision id: 359671
  • Created:
  • Creator: Nickolay
  • Is current revision? No
  • Comment

Revision Content

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

Revision Source

<p>See <a href="/en-US/docs/" title="/en-US/docs/">http://lldb.llvm.org/index.html</a></p>
<h2>Starting a debugging session</h2>
<h3>Attaching to an existing process</h3>
<p>You can attach to Firefox with following command:</p>
<pre class="eval">
(lldb) process attach --name firefox
</pre>
<p>Some versions of lldb causes crashes after attaching to Firefox.</p>
<h3>Running a new process</h3>
<p>To start Firefox under the debugger, run <code>lldb</code> followed by "--", followed by the command line you'd like to run, like this:</p>
<pre>
$ lldb -- obj-ff-dbg/dist/Nightly.app/Contents/MacOS/firefox-bin -no-remote -profile /path/to/profile</pre>
<p>Then set breakpoints you need and start the process:</p>
<pre>
(lldb) breakpoint set --name nsInProcessTabChildGlobal::InitTabChildGlobal
Breakpoint created: 1: name = 'nsInProcessTabChildGlobal::InitTabChildGlobal', locations = 0 (pending)
WARNING:&nbsp; 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&nbsp; added to breakpoint 1
</pre>
Revert to this revision