Bug 67102

Summary: Update Debugging on Mac OS X instructions for Safari 5.1/WebKit 2
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit WebsiteAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, leviw, mitz, mjs, rniwa, sam, timothy, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 66596    
Attachments:
Description Flags
Work-in-progress patch
none
Patch
none
Screenshot of debug.html
none
Screenshot of debug-mac-uiprocess.html none

Description Daniel Bates 2011-08-28 21:30:31 PDT
Update the Mac OS X instructions on <http://www.webkit.org/building/debug.html> to explain how to debug Safari 5.1/WebKit 2.

See <https://trac.webkit.org/wiki/Debugging%20the%20WebKit2%20Web%20Process>.
Comment 1 Daniel Bates 2011-08-28 21:55:48 PDT
Created attachment 105458 [details]
Work-in-progress patch

Work-in-progress patch

I took the "attach to WebProcess" instructions on <https://trac.webkit.org/wiki/Debugging%20the%20WebKit2%20Web%20Process> as inspiration for these updated instructions. In particular, I added WebProcess.app as the custom executable in the WebCore project and made Xcode wait for WebProcess.app to launch. Then ran run-safari to launch Safari. 

I am not so happy with this setup since it alternates between Xcode and the command line.
Comment 2 Daniel Bates 2012-01-12 12:15:22 PST
Created attachment 122285 [details]
Patch
Comment 3 Daniel Bates 2012-01-12 12:17:13 PST
Created attachment 122286 [details]
Screenshot of debug.html
Comment 4 Daniel Bates 2012-01-12 12:18:23 PST
Created attachment 122287 [details]
Screenshot of debug-mac-uiprocess.html
Comment 5 Eric Seidel (no email) 2012-01-19 10:56:46 PST
Comment on attachment 122285 [details]
Patch

This seems OK to me.  Certainly better than the very outdated instructions we have now.
Comment 6 WebKit Review Bot 2012-01-19 12:04:00 PST
Comment on attachment 122285 [details]
Patch

Clearing flags on attachment: 122285

Committed r105432: <http://trac.webkit.org/changeset/105432>
Comment 7 WebKit Review Bot 2012-01-19 12:04:07 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 mitz 2012-01-19 12:12:13 PST
(In reply to comment #1)
> Created an attachment (id=105458) [details]
> Work-in-progress patch
> 
> Work-in-progress patch
> 
> I took the "attach to WebProcess" instructions on <https://trac.webkit.org/wiki/Debugging%20the%20WebKit2%20Web%20Process> as inspiration for these updated instructions. In particular, I added WebProcess.app as the custom executable in the WebCore project and made Xcode wait for WebProcess.app to launch. Then ran run-safari to launch Safari. 
> 
> I am not so happy with this setup since it alternates between Xcode and the command line.

There is a more streamlined way to do this now that bug 75444 is fixed. You can have create a scheme whose executable is WebProcess and pass it the command-line options to launch the client (the UI process). The arguments look something like
    "$(BUILT_PRODUCTS_DIR)/WebKit2.framework/WebKit2" -type webprocess -client-executable /Applications/Safari.app/Contents/MacOS/Safari
and the environment should contain
    DYLD_INSERT_LIBRARIES=$(BUILT_PRODUCTS_DIR)/WebProcessShim.dylib
Comment 9 Eric Seidel (no email) 2012-01-19 12:13:19 PST
(In reply to comment #8)
> (In reply to comment #1)
> > Created an attachment (id=105458) [details] [details]
> > Work-in-progress patch
> > 
> > Work-in-progress patch
> > 
> > I took the "attach to WebProcess" instructions on <https://trac.webkit.org/wiki/Debugging%20the%20WebKit2%20Web%20Process> as inspiration for these updated instructions. In particular, I added WebProcess.app as the custom executable in the WebCore project and made Xcode wait for WebProcess.app to launch. Then ran run-safari to launch Safari. 
> > 
> > I am not so happy with this setup since it alternates between Xcode and the command line.
> 
> There is a more streamlined way to do this now that bug 75444 is fixed. You can have create a scheme whose executable is WebProcess and pass it the command-line options to launch the client (the UI process). The arguments look something like
>     "$(BUILT_PRODUCTS_DIR)/WebKit2.framework/WebKit2" -type webprocess -client-executable /Applications/Safari.app/Contents/MacOS/Safari
> and the environment should contain
>     DYLD_INSERT_LIBRARIES=$(BUILT_PRODUCTS_DIR)/WebProcessShim.dylib

Sounds useful.

Could we check in such a scheme into the repo?