Mercurial Source Server 0.1 Instructions

From CDOT Wiki
Revision as of 19:58, 18 October 2008 by JesseV (talk | contribs)
Jump to: navigation, search

Source Server Setup Instructions

To set up the source server on your page, see this page.

NOTE: I was only able to get this to work when linking my debugger (Visual Studio 2008) to Firefox, not Minefield. I used Firefox 3.0.3.

0.1 Instructions

Download this file. The contents of this zip file can be modified in two possible ways.

NOTE: Make sure you've set up the source server and downloaded the pdb files into whatever directory you specified in either Visual Studio or WinDbg. Personally I use Visual Studio 2008.

First Method

In the zip file you've just downloaded, there is a folder called xul.pdb. Copy this folder into the location of your source files to override the existing xul.pdb.

Second Method

In the zip file you've just downloaded, there is a file named Copy this file to <wherever you store your symbols>/xul.pdb/<random binary value>/, you should see the actual .pdb file in this folder.

Next, if you don't have the Debugging Tools For Windows, download them here. Once you install the tools, add the srcsrv folder to your system's PATH. Back to the folder with xul.pdb and In your command line, run pdbstr -w -p:xul.pdb -s:srcsrv. To make sure the stream was inserted properly, run pdbstr -r -p:xul.pdb -s:srcsrv. You should see the following output:

SRCSRV: ini ------------------------------------------------
SRCSRV: variables ------------------------------------------
SRCSRV: source files ---------------------------------------
SRCSRV: end ------------------------------------------------

If you see this output, you've successfully modified the pdb file.

Re-running the Source Server

Re-run visual studio (or WinDbg if you prefer) using your existing source server settings, attach to firefox.exe. After the symbols have been loaded, switch to the call stack. Keep in mind that the old xul.pdb had over 6000 indexed source files, while the new xul.pdb has only 6 indexed source files for testing purposes.

In the call stack, look for a call to nsBaseAppShell.cpp. If you try to grab source files for another method inside xul.dll (by double clicking on the stack line), it won't work. If you try to open a line call outside of xul.dll, you'll most likely be asked to execute a cvs command.

However, if you try to click on a line call inside nsBaseAppShell.cpp (you should see this file often in the stack) you'll notice in the status bar in the bottom left corner that Visual Studio is downloading the files from, followed by the nsBaseAppShell.cpp file being opened up in VS. For further proof, right click on the nsBaseAppShell.cpp tab and select Open Containing Folder. You should see a location similar to the following:

Mercurial destination.jpg

This address shows that the file was downloaded from the mozilla-central tree.