Using the Mozilla symbol server

  • Revision slug: Using_the_Mozilla_symbol_server
  • Revision title: Using the Mozilla symbol server
  • Revision id: 21666
  • Created:
  • Creator: Jonathan_Watt
  • Is current revision? No
  • Comment 37 words added

Revision Content

The Mozilla project runs a symbol server for trunk Firefox nightly and release builds on Windows. Symbols are available for at least 30 previous days worth of nightly builds, and Firefox releases from 2.0.0.4. This allows debugging of those builds without forcing all users to download large debugging files. The server functions like Microsoft's symbol server so the documentation there can be useful.

Even with Mozilla symbol server, debugging release builds is not always easy as the debugger will not be able to show you the content of all variables and the execution path can seem strange. To avoid this problem, try using a debug Firefox nightly from tinderbox instead. Debug nightlies are currently only available for trunk and not for the older branches on tinderbox.

The official symbol server URL for Firefox is http://symbols.mozilla.org/firefox and for xulrunner http://symbols.mozilla.org/xulrunner. You cannot visit this URL directly: you must add it to the symbol path of your debugging tool. In the examples below, a local cache directory is used to avoid repeatedly fetching the PDB from the server. Replace C:\Users\bsmedberg\symbols with an appropriate cache directory on your machine.

Symbols are also available for try server builds from http://build.mozilla.org/tryserver-symbols/.

Using the symbol server in Microsoft Visual C++ 2005+

Choose Tools - Enter source server url and local cache path

Using the symbol server in Windbg

The Windbg symbol path is configured with a string value delimited with asterisk characters. To use only the Mozilla symbol server, add the following entry to your symbol path (note: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols):

 SRV*c:\symcache\*http://symbols.mozilla.org/firefox

Set this string as _NT_SYMBOL_PATH in the environment, using the Windbg menus, or by typing the .sympath command. If you would like to get symbols from Microsoft's symbol server as well, you should list that first (note: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols):

 SRV*c:\symcache\*http://msdl.microsoft.com/download/symbols;SRV*c:\symcache\*http://symbols.mozilla.org/firefox

Image:symbol-server-windbg-menu.jpg Image:symbol-server-windbg-dialog.jpg

Downloading symbols using symchk.exe

You can also download the symbols using symchk.exe, part of Microsoft's Debugging Tools for Windows. The command should look like this (again, you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols):

C:\Program Files\Mozilla Firefox>c:\progra~1\debugg~1\symchk.exe /r c:\progra~1\mozill~1\* /s SRV*C:\symcache\*http://symbols.mozilla.org/firefox

Note the \* after the Mozilla directory. The output of this command should be similar to:

SYMCHK: fullsoft.dll         FAILED  - Image is split correctly, but fullsoft.dbg is missing
SYMCHK: qfaservices.dll      FAILED  - qfaservices.pdb mismatched or not found
SYMCHK: talkback.exe         FAILED  - Built without debugging information.
SYMCHK: helper.exe           FAILED  - Built without debugging information.

SYMCHK: FAILED files = 4
SYMCHK: PASSED + IGNORED files = 179

Downloading symbols on Linux / Mac OS X

For Linux and Mac OS X there is a Python script to download symbols from the Mozilla symbol server for gdb, Shark and other software that uses symbols. Note that the symbol file for the XUL library is very large and takes some time to download. This may make it appear as if the script has gotten stuck, but it will continue.

Symbol indices are named like so: symbols.mozilla.org/{lowercased:Name}/{lowercased:Name}-{Version}-Linux-{BuildID}-symbols.txt, where the values are as follows, based on the contents of the application.ini file under the [App] heading.  For example, the Thunderbird 3.1b2 release with Name=Thunderbird, Version=3.1b2, BuildID=20100430125415 would have a filename of "thunderbird-3.1b2-Linux-20100430125415-symbols.txt" under the thunderbird directory at symbols.mozilla.org.  Its contents are a list of paths to files, all relative to the directory the BLAH-symbols.txt file is found in.

The source server

In addition to symbols, Mozilla also has a source server, letting you do source-level debugging and inspection on demand.

Revision Source

<p>The Mozilla project runs a symbol server for trunk Firefox nightly and release builds on Windows. Symbols are available for at least 30 previous days worth of nightly builds, and Firefox releases from 2.0.0.4. This allows debugging of those builds without forcing all users to download large debugging files. The server functions like <a class="external" href="http://support.microsoft.com/kb/311503">Microsoft's symbol server</a> so the documentation there can be useful.</p>
<p>Even with Mozilla symbol server, debugging release builds is not always easy as the debugger will not be able to show you the content of all variables and the execution path can seem strange. To avoid this problem, <a href="/en/Tinderbox#Downloading_the_tinderbox_builds" title="en/Tinderbox#Downloading the tinderbox builds">try using a debug Firefox nightly from tinderbox instead</a>. Debug nightlies are currently only available for trunk and not for the older branches on tinderbox.</p>
<p>The official symbol server URL for Firefox is <a class=" external" href="http://symbols.mozilla.org/firefox" rel="freelink">http://symbols.mozilla.org/firefox</a> and for xulrunner <a class=" external" href="http://symbols.mozilla.org/xulrunner" rel="freelink">http://symbols.mozilla.org/xulrunner</a>. You cannot visit this URL directly: you must add it to the symbol path of your debugging tool. In the examples below, a local cache directory is used to avoid repeatedly fetching the PDB from the server. Replace <code>C:\Users\bsmedberg\symbols</code> with an appropriate cache directory on your machine.</p>
<p>Symbols are also available for <a class="link-https" href="https://wiki.mozilla.org/Build:TryServer" title="https://wiki.mozilla.org/Build:TryServer">try server</a> builds from <a class=" external" href="http://build.mozilla.org/tryserver-symbols/" rel="freelink">http://build.mozilla.org/tryserver-symbols/</a>.</p>
<h3 name="Using_the_symbol_server_in_Microsoft_Visual_C.2B.2B_2005.2B">Using the symbol server in Microsoft Visual C++ 2005+</h3>
<p><img alt="Choose Tools -" class="internal" src="/@api/deki/files/875/=Symbol-server-vc8express-menu.jpg"> <img alt="Enter source server url and local cache path" class="internal" src="/@api/deki/files/2860/=2005_options.gif"></p>
<h3 name="Using_the_symbol_server_in_Windbg">Using the symbol server in Windbg</h3>
<p>The Windbg symbol path is configured with a string value delimited with asterisk characters. To use only the Mozilla symbol server, add the following entry to your symbol path (<strong>note:</strong> you can replace c<code>:\symcache\</code> with any writable directory on your computer, if you'd prefer a different location for downloaded symbols):</p>
<pre class="eval"> <span class="nowiki">SRV*c:\symcache\*http://symbols.mozilla.org/firefox</span>
</pre>
<p>Set this string as <code>_NT_SYMBOL_PATH</code> in the environment, using the Windbg menus, or by typing the <code>.sympath</code> command. If you would like to get symbols from Microsoft's symbol server as well, you should list that first (<strong>note:</strong> you can replace c<code>:\symcache\</code> with any writable directory on your computer, if you'd prefer a different location for downloaded symbols):</p>
<pre class="eval"> <span class="nowiki">SRV*c:\symcache\*http://msdl.microsoft.com/download/symbols;SRV*c:\symcache\*http://symbols.mozilla.org/firefox</span>
</pre>
<p><img alt="Image:symbol-server-windbg-menu.jpg" class="internal" src="/@api/deki/files/877/=Symbol-server-windbg-menu.jpg"> <img alt="Image:symbol-server-windbg-dialog.jpg" class="internal" src="/@api/deki/files/876/=Symbol-server-windbg-dialog.jpg"></p>
<h3 name="Downloading_symbols_using_symchk.exe">Downloading symbols using symchk.exe</h3>
<p>You can also download the symbols using symchk.exe, part of Microsoft's Debugging Tools for Windows. The command should look like this (again, you can replace c<code>:\symcache\</code> with any writable directory on your computer, if you'd prefer a different location for downloaded symbols):</p>
<pre>C:\Program Files\Mozilla Firefox&gt;c:\progra~1\debugg~1\symchk.exe /r c:\progra~1\mozill~1\* /s SRV*C:\symcache\*http://symbols.mozilla.org/firefox
</pre>
<p>Note the <code>\*</code> after the Mozilla directory. The output of this command should be similar to:</p>
<pre>SYMCHK: fullsoft.dll         FAILED  - Image is split correctly, but fullsoft.dbg is missing
SYMCHK: qfaservices.dll      FAILED  - qfaservices.pdb mismatched or not found
SYMCHK: talkback.exe         FAILED  - Built without debugging information.
SYMCHK: helper.exe           FAILED  - Built without debugging information.

SYMCHK: FAILED files = 4
SYMCHK: PASSED + IGNORED files = 179
</pre>
<h3 name="The_source_server">Downloading symbols on Linux / Mac OS X</h3>
<p>For Linux and Mac OS X there is a <a class=" external" href="http://hg.mozilla.org/users/jwatt_jwatt.org/fetch-symbols" title="http://hg.mozilla.org/users/jwatt_jwatt.org/fetch-symbols">Python script to download symbols from the Mozilla symbol server</a> for <a href="/en/Debugging_Mozilla_with_gdb" title="en/Debugging Mozilla with gdb">gdb</a>, Shark and other software that uses symbols. Note that the symbol file for the XUL library is very large and takes some time to download. This may make it appear as if the script has gotten stuck, but it will continue.</p>
<p>Symbol indices are named like so: symbols.mozilla.org/{lowercased:Name}/{lowercased:Name}-{Version}-Linux-{BuildID}-symbols.txt, where the values are as follows, based on the contents of the application.ini file under the [App] heading.  For example, the Thunderbird 3.1b2 release with Name=Thunderbird, Version=3.1b2, BuildID=20100430125415 would have a filename of "thunderbird-3.1b2-Linux-20100430125415-symbols.txt" under the thunderbird directory at symbols.mozilla.org.  Its contents are a list of paths to files, all relative to the directory the BLAH-symbols.txt file is found in.</p><h3 name="The_source_server">The source server</h3>
<p>In addition to symbols, Mozilla also has a <a href="/en/Using_the_Mozilla_source_server" title="en/Using_the_Mozilla_source_server">source server</a>, letting you do source-level debugging and inspection on demand.</p>
Revert to this revision