Using Visual Studio 2010 IDE来调试firefox源码
2012-08-23 01:01
169 查看
Setting up the build is somewhat straight forward on windows however I could not find any instructions on setting up a Visual Studio project for editing and debugging. I’m writing down the instructions I was given on IRC for my future benefits and for others.
I hope at some point someone will take the initiative to put this information on MDN.
These instructions start from the point where you have a simple
build of Firefox completed with the latest windows SDK and VS 10.
Create a new project using ‘Project from Existing Code’ (See Joe Walker’s comment if you don’t have this).
Select ‘Visual C++’, enter a project name (ex: mozilla-central), source directory as project file location, select ‘Show all files in Solution Explorer’.
Make sure you un-select ‘Add Files to the project from these folders’, hit Next.
Select ‘Use external build system’, hit Finish.
Project will be empty until you select ‘Show all Files’ from the solution explorer, File -> close the solution, re-open it. Source files should appear (I had to do this step 3 times)
For autocomplete select Project ->Properties -> NMake.
Under ‘Preprocessor Definitions’ add XP_WIN (return here later to add any definition your may be compiling with/find missing)
Under ‘Include Search Path’ type in ‘<objdir>\dist\include’ (I recommend to have built your project from command line for this step)
For debugging select ‘Debugging’ still under the property page, type in the absolute path to firefox.exe. Recommended command argument ‘-P “Minefield” -no-remote’.
I
strongly recommend using ‘Console’ when working from the command line.
Optional: Add a build/clean target (Can otherwise be done outside of Visual Studio using the command line)
Create a single script, build.sh, that you can invoke that will trigger a build with the configuration you need. It should set all environment variables needed.
Copy the ‘mozilla-build/start-msvc10.bat’ to ‘mozilla-build/start-msvc10-build.bat’.
Replace the last line to read something like ‘”%MOZILLABUILD%”\msys\bin\bash –login <path-to-your-build-script>/build.sh’.
Select Project->Properties->NMake, for Build Command Line type ‘C:\mozilla-build\start-msvc10-build.bat’.
Advanced: Create multiple project configuration for each mozconfig build configuration
you would like to work with then have them invoke specific build scripts and firefox.exe.
You can modify your script to do incremental
builds to reduce your turn around time.
http://benoitgirard.wordpress.com/2011/05/27/using-visual-studio-2010-ide/
I hope at some point someone will take the initiative to put this information on MDN.
These instructions start from the point where you have a simple
build of Firefox completed with the latest windows SDK and VS 10.
Create a new project using ‘Project from Existing Code’ (See Joe Walker’s comment if you don’t have this).
Select ‘Visual C++’, enter a project name (ex: mozilla-central), source directory as project file location, select ‘Show all files in Solution Explorer’.
Make sure you un-select ‘Add Files to the project from these folders’, hit Next.
Select ‘Use external build system’, hit Finish.
Project will be empty until you select ‘Show all Files’ from the solution explorer, File -> close the solution, re-open it. Source files should appear (I had to do this step 3 times)
For autocomplete select Project ->Properties -> NMake.
Under ‘Preprocessor Definitions’ add XP_WIN (return here later to add any definition your may be compiling with/find missing)
Under ‘Include Search Path’ type in ‘<objdir>\dist\include’ (I recommend to have built your project from command line for this step)
For debugging select ‘Debugging’ still under the property page, type in the absolute path to firefox.exe. Recommended command argument ‘-P “Minefield” -no-remote’.
I
strongly recommend using ‘Console’ when working from the command line.
Optional: Add a build/clean target (Can otherwise be done outside of Visual Studio using the command line)
Create a single script, build.sh, that you can invoke that will trigger a build with the configuration you need. It should set all environment variables needed.
Copy the ‘mozilla-build/start-msvc10.bat’ to ‘mozilla-build/start-msvc10-build.bat’.
Replace the last line to read something like ‘”%MOZILLABUILD%”\msys\bin\bash –login <path-to-your-build-script>/build.sh’.
Select Project->Properties->NMake, for Build Command Line type ‘C:\mozilla-build\start-msvc10-build.bat’.
Advanced: Create multiple project configuration for each mozconfig build configuration
you would like to work with then have them invoke specific build scripts and firefox.exe.
You can modify your script to do incremental
builds to reduce your turn around time.
http://benoitgirard.wordpress.com/2011/05/27/using-visual-studio-2010-ide/
相关文章推荐
- Visual Studio 2010 系统重新安装以后无法调试的问题
- 使用Visual Studio 2010开发和调试Html5项目
- IDE:Visual Studio 2010 快捷键
- Visual Studio 2010 Concept IDE(转!非常有意思)
- IIS附加进程在Visual Studio 2010 中进行调试(高级)
- visual studio 2010 调试
- 使用Visual Studio 2010调试断点不起作用的问题解决办法
- 精进不休 .NET 4.0 (3) - asp.net 4.0 新特性之动态数据(Dynamic Data)增强, AJAX增强; IDE之Visual Studio 2010增强
- 精进不休 .NET 4.0 (3) - asp.net 4.0 新特性之动态数据(Dynamic Data)增强, AJAX增强; IDE之Visual Studio 2010增强
- 【IDE-Visual Studio】如何在使用vs调试如何才能不显示反汇编?
- 使用visual studio 2010 的IIS express 调试oracle
- Visual Studio 2010 按F5调试运行报 无法启动程序 没有更多的文件
- Visual Studio 2010并行编程及调试诊断功能详解
- Visual Studio 2012/2010/2008 远程调试
- Visual Studio 2010为 C# 开发人员提供的新的IDE功能
- Visual Studio 2010初学者的调试指南:Mastering Debugging in Visual Studio 2010 - A Beginner's Guide
- Visual Studio 2010/2013 UTF8编码调试时显示中文
- Visual Studio 2010 概念型IDE
- Visual Studio 2010开发AutoCAD 2012 .net 应用程序调试时断点不起作用
- 在 Visual Studio 2010 中启动 MPI 群集调试程序