Bug 129524

Summary: Web Inspector: debugger statements do not break
Product: WebKit Reporter: Jonathan Wells <jonowells>
Component: Web InspectorAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Major CC: graouts, joepeck, jonowells, mark.lam, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.9   
Attachments:
Description Flags
Web archive to reproduce the breakpoint bug.
none
debugger statement test case
none
the patch: now supporting debugger statements.
mark.lam: review-
patch 2 ggaren: review+

Description Jonathan Wells 2014-02-28 17:34:10 PST
Created attachment 225512 [details]
Web archive to reproduce the breakpoint bug.

Breakpoints do not seem to work. `debugger;` statements are skipped entirely. Breakpoints inserted in the inspector pretty print editor will not break the execution in WebKit r164860.

To reproduce for the debugger statement:

1. Open the attached breakpoint.webarchive
2. Open the web inspector
3. In the console, call: foo(). 

No breaking will occur.

To reproduce manually:

1. Open the attached breakpoint.webarchive
2. Open the web inspector
3. Click on Resources and open main.js
4. Add a breakpoint inside foo() on line 3 (the variable assignment)
5. Refresh the page.
Comment 1 Radar WebKit Bug Importer 2014-02-28 17:34:42 PST
<rdar://problem/16202928>
Comment 2 Mark Lam 2014-03-03 12:00:35 PST
Created attachment 225678 [details]
debugger statement test case

The previously attached test case has a bug where the function containing the debugger statement was never called.  Here's a new one.
Comment 3 Mark Lam 2014-03-03 12:15:16 PST
Created attachment 225681 [details]
the patch: now supporting debugger statements.
Comment 4 Mark Lam 2014-03-03 12:26:18 PST
Comment on attachment 225681 [details]
the patch: now supporting debugger statements.

This patch causes many unexpected inspector regressions. Looking into it.
Comment 5 Mark Lam 2014-03-03 13:01:28 PST
Created attachment 225685 [details]
patch 2

The previous patch has a union - struct tree that is a little too complex.  The result is that the compiler ended up expressing the outermost union as a struct instead.  In patch2, I flattened the union to only contain an unsigned and a struct.  With this, the inspector tests are passing again.
Comment 6 Geoffrey Garen 2014-03-03 13:56:56 PST
Comment on attachment 225685 [details]
patch 2

r=me
Comment 7 Mark Lam 2014-03-03 14:07:55 PST
Thanks.  Landed in r165008: <http://trac.webkit.org/r165008>.