| <?php |
| $title = "Debugging WebKit"; |
| include("../header.inc"); |
| ?> |
| |
| <div class="mac-instructions"> |
| <h2>Debugging on Mac OS X</h2> |
| <ol> |
| <li><p>Open a project</p> |
| <p>Each WebKit component -- JavaScriptCore, WebCore, and WebKit -- contains its own Xcode project. Open the project belonging to the component you want to debug.</p> |
| </li> |
| <li><p>Set the project's build products location</p> |
| <p>To find the WebKit you built, Xcode needs to know the build products location that <code>build-webkit</code> used. You can set the build products location from the project's Info window.</p> |
| <img src="info-tab.png"> |
| </li> |
| <li><p>Set the project's active build configuration</p> |
| <p>Xcode also needs to know the build configuration you used. You can set the active build configuration from the project's Build window.</p> |
| <img src="build-window.png"> |
| </li> |
| <li><p>Add a custom executable to the project</p> |
| <p>Choose any WebKit application you want to use for debugging. To use Safari, select /Applications/Safari.app.</p> |
| <img src="custom-executable.png"> |
| </li> |
| <li><p>Set the project's active executable</p> |
| <p>You can set the active executable from the project's Build window. Choose the executable you just added.</p> |
| </li> |
| <li><p>Close and re-open the project</p> |
| <p>This will force Xcode to discover generated source files, which output to your build products location, allowing you to set breakpoints in them.</p> |
| </li> |
| <li><p>Launch the debugger</p> |
| <p>In the Debugger window, click the "Debug" button.</p> |
| <img src="debug.png"> |
| </li> |
| <li><p>See the <a href="http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeDebugging/index.html">Xcode Debugging Guide</a> for more information on using Xcode to debug software on Mac OS X.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="windows-instructions"> |
| <h2>Debugging on Windows</h2> |
| <ol> |
| <li><p>Open <code>WebKit/WebKit/win/WebKit.vcproj/WebKit.sln</code></p> |
| <p>You can open it in either Visual Studio 2005, or Visual C++ Express 2005. |
| If you get errors about not being able to find <code>.vsprops</code> files, run |
| update-webkit, then close and relaunch Cygwin and Visual Studio or Visual C++ |
| Express.</p> |
| </li> |
| <li><p>Set WebKit.vcproj as the solution's StartUp project</p> |
| <p>Select the WebKit project in the Solution Explorer, then choose Project > |
| Set as StartUp Project. This will cause the project to turn bold in the |
| Solution Explorer.</p> |
| <img src="set-as-startup-project-vs2005.png"> |
| </li> |
| <li><p>Set WebKit.vcproj's Debugging properties</p> |
| <p>With the WebKit project selected, choose Project > Properties, then navigate |
| to Configuration Properties > Debugging. Set the following options:</p> |
| <dl> |
| <dt>Command</dt> |
| <dd><code>$(PROGRAMFILES)\Safari\Safari.exe</code></dd> |
| <dt>Environment</dt> |
| <dd><code>WEBKITNIGHTLY=$(OutDir)</code></dd> |
| </dl> |
| <p>Then click <code>OK</code> to close the properties dialog.</p> |
| <img src="set-debugging-properties-vs2005.png"> |
| </li> |
| <li><p>Launch the debugger</p> |
| <p>Choose Debug > Start Debugging.</p> |
| <img src="launch-debugger-vs2005.png"> |
| </ol> |
| <p>It is also recommended that you follow <a href="http://developer.apple.com/internet/safari/windows_symbols_agree.html">the instructions to configure Visual Studio to use Apple's Safari for Windows symbol server</a>. This will give Visual Studio the information it needs to provide reliable backtraces when pausing in the debugger or when a crash occurs.</p> |
| </div> |
| |
| <?php |
| include("../footer.inc"); |
| ?> |