Debugging on Mac OS X

  1. Open a project

    Each WebKit component -- JavaScriptCore, WebCore, and WebKit -- contains its own Xcode project. Open the project belonging to the component you want to debug.

  2. Set the project's build products location

    To find the WebKit you built, Xcode needs to know the build products location that build-webkit used. You can set the build products location from the project's Info window.

  3. Set the project's active build configuration

    Xcode also needs to know the build configuration you used. You can set the active build configuration from the project's Build window.

  4. Add a custom executable to the project

    Choose any WebKit application you want to use for debugging. To use Safari, select /Applications/Safari.app.

  5. Set the project's active executable

    You can set the active executable from the project's Build window. Choose the executable you just added.

  6. Close and re-open the project

    This will force Xcode to discover generated source files, which output to your build products location, allowing you to set breakpoints in them.

  7. Launch the debugger

    In the Debugger window, click the "Debug" button.

Debugging on Windows

You can launch the Visual Studio development environment with the following command:

devenv /debugexe Safari.exe [args to safari]

The arguments to Safari should be the same ones that run-safari uses, namely the /frameworkPath switch (to point to the path at which the updated WebKit can be found) and debug if the WebKit you built is a debug version.