Run Firefox 1.5 in Debug mode
Written By Yi Shen.
Introduction
I previously wrote how to build Firefox in Windows, and here I was work on how to run firefox 1.5 in debug mode by Visual Studio 2003 debuger and better understand how certain things work.
Required
- Firefox 1.5 already build on Windows
- Microsoft Visual Studio 2003 installed
Instructions
First we need open the Firefox project in Visual Studio:
File>Open>Project...
This will start the Open Project Dialog and you should navigate to your firefox.exe directory, for me it is:
C:\proj\mozilla\hopefullyWorked.firefox.optimized\dist\bin
]]
Visual Studio will create a Solution File (.sln) in the same directory as firefox.exe and give you the Solution Explorer
Now we are ready to set a breakpoint in a source file so we can stop Firefox and inspect it running at the appropriate point. Open a source file
File > Open > File...
For example a file need in our project which Canvas Rendering 2D Object:
C:\proj\mozilla\content\canvas\src\nsCanvasRenderingContext2D.cpp
Then locate a line for your breakpoint and click to the left of the line number in the gray selection border then it set a red circle:
Now we can run Firefox from Visual Studio by pressing F5 or by clicking Debug > Start Debugging, This will require you to save firefox.sln file, save it within the firefox.exe directory:
:
Then Visual Studio will run a console window with lots of messages related to debugging within the code. We will end up at the location of the breakpoint(if it is called during the compiling).
Now we have Firefox in debug mode. We can navigate to the code that building Canvus Objects by setting up breakpoints in file.