The WebKit Open Source Project

Debugging on Mac OS X

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 build-webkit 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’t need to do this.

Internal Debug Menu

There is a Debug menu that can be enabled in Safari, and it supplies many useful options to help with debugging. To enable it, run the following in your terminal: defaults write com.apple.Safari IncludeInternalDebugMenu 1

Debugging UIProcess

Follow the instructions on the debugging UIProcess page.

Debugging WebProcess

Current versions of Safari use a process for each tab, so it is easy to end up with a new WebProcess and have to reattach. If you enable the Internal Debug Menu as outlined above, you can have Safari display the Process ID of the WebProcess for each tab. Simply go to Debug > Miscellaneous Flags and select Show Web Process IDs In Page Titles. You should now see something like [WP 60737] in the title of every web page you navigate to, and 60737 is the Process ID of the WebProcess backing that tab.

Debugging on Windows

  1. Open Source/WebKit/WebKit.vcxproj/WebKit.sln

    You can open it in either Visual Studio 2010, or Visual C++ Express 2010. If you get errors about not being able to find .props files, run update-webkit, then close and relaunch Cygwin and Visual Studio or Visual C++ Express.

  2. Set WinLauncher as the solution's StartUp project

    Select the WinLauncher project in the Solution Explorer, then choose Project > Set as StartUp Project. This will cause the project to turn bold in the Solution Explorer.

  3. Launch the debugger

    Choose Debug > Start Debugging.

  4. Alternatively, you can debug layout tests with DumpRenderTree

    Set DumpRenderTreeLauncher as your startup project, set the layout test as a command argument, and launch the debugger.

    In DumpRenderTreeLauncher's properties, go to Configuration Properties->Debugging and set the Command Arguments field to the full path of the layout test you want to debug, see below: