The Android Open Source Project | 9364f22 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1 | <?php |
| 2 | $title = "Debugging WebKit"; |
| 3 | include("../header.inc"); |
| 4 | ?> |
| 5 | |
| 6 | <div class="mac-instructions"> |
| 7 | <h2>Debugging on Mac OS X</h2> |
| 8 | <ol> |
| 9 | <li><p>Open a project</p> |
| 10 | <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> |
| 11 | </li> |
| 12 | <li><p>Set the project's build products location</p> |
| 13 | <p>To find the WebKit you built, Xcode needs to know the build products location that <tt>build-webkit</tt> used. You can set the build products location from the project's Info window.</p> |
| 14 | <img src="info-tab.png"> |
| 15 | </li> |
| 16 | <li><p>Set the project's active build configuration</p> |
| 17 | <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> |
| 18 | <img src="build-window.png"> |
| 19 | </li> |
| 20 | <li><p>Add a custom executable to the project</p> |
| 21 | <p>Choose any WebKit application you want to use for debugging. To use Safari, select /Applications/Safari.app.</p> |
| 22 | <img src="custom-executable.png"> |
| 23 | </li> |
| 24 | <li><p>Set the project's active executable</p> |
| 25 | <p>You can set the active executable from the project's Build window. Choose the executable you just added.</p> |
| 26 | </li> |
| 27 | <li><p>Close and re-open the project</p> |
| 28 | <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> |
| 29 | </li> |
| 30 | <li><p>Launch the debugger</p> |
| 31 | <p>In the Debugger window, click the "Debug" button.</p> |
| 32 | <img src="debug.png"> |
| 33 | </li> |
| 34 | </ol> |
| 35 | </div> |
| 36 | <div class="windows-instructions"> |
| 37 | <h2>Debugging on Windows</h2> |
| 38 | <p>To launch Safari in the Visual Studio or Visual C++ Express debugger, simply run:</p> |
| 39 | <p class="code">debug-safari</p> |
| 40 | <p>This command will launch the Visual Studio debugging environment, and attach to Safari connected to the debug build of WebKit.dll. There are a few things to keep in mind: |
| 41 | <ul> |
| 42 | <li>The instance of Safari is not running yet. You must press the F5 key (or the 'Run' button) to see anything happen.</li> |
| 43 | <li>If you want to set any breakpoints, you must navigate to the particular source file you wish to investigate using the "File|Open" menu.</li> |
| 44 | <li><p>If you want to see the helpful output debug messages, you should edit the debug settings for the Safari solution (i.e., the pseudo-project created when the debugger attached to Safari):</p> |
| 45 | <img src="debug_vs2005.jpg"> |
| 46 | <p>You should consider including the command-line switch '<span class="code">/console</span>'. This causes Safari to run with an open DOS shell in which output messages, created with the <span class="code">LOG</span> macro, appear.</p> |
| 47 | <img src="console_vs2005.jpg"></li> |
| 48 | </ul></p> |
| 49 | </div> |
| 50 | |
| 51 | <?php |
| 52 | include("../footer.inc"); |
| 53 | ?> |