blob: 3d1e7de5f0e48099049dc32ea264879f95f17c81 [file] [log] [blame]
<?php
$title = "Debugging WebKit";
include("../header.inc");
?>
<div class="mac-instructions">
<h2>Debugging on Mac OS X</h2>
<p>To debug from within Xcode, you can use the WebKit workspace. Ensure that the Products and Intermediates locations for the workspace match those used by <code>build-webkit</code> by choosing File > Workspace Settings and clicking the Advanced button, selecting Custom, Relative to Workspace, and entering WebKitBuild both for Products and for Intermediates. Note that if you have specified a custom build location in Xcode preferences, then you don&rsquo;t need to do this.</p>
<h3>Debugging UIProcess</h3>
<p>Follow the instructions on the <a href="debug-mac-uiprocess.html">debugging UIProcess</a> page.</p>
<h3>Debugging WebProcess</h3>
<ul>
<li>
<p>From the command line:</p>
<p>Execute the <code>debug-safari</code> or <code>debug-minibrowser</code> <a href="/coding/scripts.html">script</a> with the <code>--target-web-process</code> option. It will start the debugger with WebProcess as the target and with command-line arguments that will make WebProcess run Safari or MiniBrowser as its client. At the debugger prompt, enter <code>run</code> to start the process.</p>
</li>
<li>
<p>From Xcode:</p>
<p>Open the WebKit workspace and choose &ldquo;All Source (target WebProcess)&rdquo; from the Scheme pop-up menu in the toolbar, then choose Product > Run. If WebKit is already built, it is quicker to choose Product > Perform Action > Run Without Building</p>
</li>
</ul>
</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");
?>