Bug 135517

Summary: Web Inspector: breakpoint resolved state should not depend on all breakpoints being enabled
Product: WebKit Reporter: Brian Burg <burg>
Component: Web InspectorAssignee: Brian Burg <burg>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch joepeck: review+

Description Brian Burg 2014-08-01 12:09:47 PDT
The breakpoint model consults WebInspector.debuggerManager.breakpointsEnabled, which prevents this invariant from being true.

Breakpoint.resolved should not be used as a crutch for styling breakpoint widgets.
Comment 1 Radar WebKit Bug Importer 2014-08-01 12:10:36 PDT
<rdar://problem/17887540>
Comment 2 Brian Burg 2014-08-06 12:55:51 PDT
Even with fixing breakpoint.resolved digging into DebuggerManager, this is stil not true.

There are several places where we set breakpoint.resolved = true|false temporarily, but don't detach or reattach a sourceCode to the location.
Comment 3 Brian Burg 2014-08-06 17:05:48 PDT
Created attachment 236153 [details]
Patch
Comment 4 Joseph Pecoraro 2014-08-06 17:26:33 PDT
Comment on attachment 236153 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=236153&action=review

r=me assuming those lines just need to be swapped. If not, then this probably needs another patch.

> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:310
> +            breakpoint.sourceCodeLocation.sourceCode = sourceCodeLocation.sourceCode;
> +            var sourceCodeLocation = this._sourceCodeLocationFromPayload(location);

Err, something seems aloof here. Did the lines get swapped or is "sourceCodeLocation" coming from somewhere else in line 309 making line 310 unnecessary?

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:389
> +        for (breakpoint of breakpoints)

Needs "var breakpoint" or you'll leak a global.
Comment 5 Brian Burg 2014-08-06 17:32:18 PDT
Comment on attachment 236153 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=236153&action=review

>> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:310
>> +            var sourceCodeLocation = this._sourceCodeLocationFromPayload(location);
> 
> Err, something seems aloof here. Did the lines get swapped or is "sourceCodeLocation" coming from somewhere else in line 309 making line 310 unnecessary?

oops, you are right. It used to be hoisted outside the if.

>> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:389
>> +        for (breakpoint of breakpoints)
> 
> Needs "var breakpoint" or you'll leak a global.

I <3 JavaScript. Maybe.
Comment 6 Brian Burg 2014-08-06 23:23:30 PDT
Committed r172204: <http://trac.webkit.org/changeset/172204>