Using the Mozilla source server

  • Revision slug: Using_the_Mozilla_source_server
  • Revision title: Using the Mozilla source server
  • Revision id: 128914
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 11 words added, 25 words removed

Revision Content

Using the Mozilla source server is now even more feature-packed. The nightly debug builds are now also Source Indexed so that by following a couple of simple steps you can also have the source code served to you for debugging without a local build.

Note: Using the source server with Mercurial based builds (Fx 3.1) will not work until bug 440001 is fixed.

What you'll need

  • WinDbg or Visual Studio (Note: express editions will not work, but WinDbg is a free download)
  • A nightly build that was created after April 15, 2008 (but before the Mercurial switch) - go to the .../firefox/nightly/latest-trunk/ folder and grab the installer
  • cvs.exe, added to your PATH (the cvs.exe from MozillaBuild has problems, use this one instead)
Note: Do not use the CVS from MozillaBuild, it will not work!

Set up symbols

Follow the instructions for Using_the_Mozilla_symbol_server. Once the symbol path is set you must now enable Source Server.

Using the source server in WinDbg

In the WinDbg command line, type .srcfix and hit enter. This enables source server support.

Image:windbg-srcfix.png

Now, when you click on a frame in the "Calls" window, WinDbg will prompt you about running cvs to download the associated source code.

Image:Windbg-Srcsrv-prompt.png

If you click "Yes", WinDbg will display *BUSY* in the status bar while it downloads the source, and then it will automatically open the file and highlight the current line.

Image:Windbg-Srcsrv-src.png

Using the source server in Visual Studio

Note: Source server support does not work correctly out of the box in Visual Studio 2005. If you install WinDBG, and copy srcsrv.dll from the WinDBG install dir to the Visual Studio install dir (replacing the existing copy) it will work.

Enable source server support under Tools -> Options. Also, disable (uncheck) the box that says "Require source files to exactly match the original version".

Image:enableSourceServer.png

Start debugging your program. Symbols will load and then when you try to step into or step over a confirmation window will appear asking if you trust the cvs command that Source Server is trying to run.

Image:cvsMessage.png

After the cvs command executes, the source file will load in the window.

Image:firefoxDebugging.png

Revision Source

<p>Using the Mozilla source server is now even more feature-packed. The nightly debug builds are now also Source Indexed so that by following a couple of simple steps you can also have the source code served to you for debugging without a local build.</p>
<div class="note"><strong>Note:</strong> Using the source server with Mercurial based builds (Fx 3.1) will not work until <a class="moz-txt-link-freetext link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=440001">bug 440001</a> is fixed.</div>
<h4 name="What_you.27ll_need">What you'll need</h4>
<ul> <li><a class="external" href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx">WinDbg</a> or Visual Studio (Note: express editions will not work, but WinDbg is a free download)</li> <li>A nightly build that was created after April 15, 2008 (but before the Mercurial switch) - go to the <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/">.../firefox/nightly/latest-trunk/</a> folder and grab the installer</li> <li>cvs.exe, added to your PATH (the cvs.exe from MozillaBuild has problems, <a class="external" href="http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip">use this one instead</a>)</li>
</ul>
<div class="note"><strong>Note:</strong> Do <em>not</em> use the CVS from MozillaBuild, it will not work!</div>
<h3 name="Set_up_Symbols">Set up symbols</h3>
<p>Follow the instructions for <a href="/en/Using_the_Mozilla_symbol_server" title="en/Using_the_Mozilla_symbol_server">Using_the_Mozilla_symbol_server</a>. Once the symbol path is set you must now enable Source Server.</p>
<h3 name="Using_the_Source_Server_in_WinDbg">Using the source server in WinDbg</h3>
<p>In the WinDbg command line, type <code>.srcfix</code> and hit enter. This enables source server support.</p>
<p><img alt="Image:windbg-srcfix.png" class="internal" src="/@api/deki/files/969/=Windbg-srcfix.png"></p>
<p>Now, when you click on a frame in the "Calls" window, WinDbg will prompt you about running cvs to download the associated source code.</p>
<p><img alt="Image:Windbg-Srcsrv-prompt.png" class="internal" src="/@api/deki/files/421/=Windbg-Srcsrv-prompt.png"></p>
<p>If you click "Yes", WinDbg will display *BUSY* in the status bar while it downloads the source, and then it will automatically open the file and highlight the current line.</p>
<p><img alt="Image:Windbg-Srcsrv-src.png" class="internal" src="/@api/deki/files/422/=Windbg-Srcsrv-src.png"></p>
<h3 name="Using_the_Source_Server_in_Visual_Studio">Using the source server in Visual Studio</h3>
<div class="note"><strong>Note: </strong>Source server support does not work correctly out of the box in Visual Studio 2005. If you install WinDBG, and copy srcsrv.dll from the WinDBG install dir to the Visual Studio install dir (replacing the existing copy) it will work.</div>
<p>Enable source server support under Tools -&gt; Options. Also, disable (uncheck) the box that says "Require source files to exactly match the original version".</p>
<p><img alt="Image:enableSourceServer.png" class="internal" src="/@api/deki/files/674/=EnableSourceServer.png"></p>
<p>Start debugging your program. Symbols will load and then when you try to step into or step over a confirmation window will appear asking if you trust the cvs command that Source Server is trying to run.</p>
<p><img alt="Image:cvsMessage.png" class="internal" src="/@api/deki/files/636/=CvsMessage.png"></p>
<p>After the cvs command executes, the source file will load in the window.</p>
<p><img alt="Image:firefoxDebugging.png" class="internal" src="/@api/deki/files/699/=FirefoxDebugging.png"></p>
Revert to this revision