Bug 59476 - Web Inspector: breakpoints set in original and formatted scripts are messed up after navigation.
Summary: Web Inspector: breakpoints set in original and formatted scripts are messed u...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Podivilov
URL:
Keywords:
Depends on: 59792
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-26 11:41 PDT by Pavel Podivilov
Modified: 2011-04-29 06:15 PDT (History)
10 users (show)

See Also:


Attachments
Patch. (33.41 KB, patch)
2011-04-26 11:46 PDT, Pavel Podivilov
no flags Details | Formatted Diff | Diff
Add test. (40.67 KB, patch)
2011-04-27 06:28 PDT, Pavel Podivilov
no flags Details | Formatted Diff | Diff
Remove all breakpoints when formatting mode is changed. (11.60 KB, patch)
2011-04-28 06:53 PDT, Pavel Podivilov
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Podivilov 2011-04-26 11:41:57 PDT
Web Inspector: breakpoints set in original and formatted scripts are messed up after navigation.

Also, sometimes breakpoints disappear from DebuggerPresentationModel (removed from _breakpointsWithoutSourceFile and never added to sourceFile.breakpoints).
Comment 1 Pavel Podivilov 2011-04-26 11:46:26 PDT
Created attachment 91134 [details]
Patch.
Comment 2 Pavel Podivilov 2011-04-27 06:28:49 PDT
Created attachment 91275 [details]
Add test.
Comment 3 Pavel Podivilov 2011-04-28 06:53:37 PDT
Created attachment 91485 [details]
Remove all breakpoints when formatting mode is changed.
Comment 4 Pavel Feldman 2011-04-28 10:46:14 PDT
Comment on attachment 91485 [details]
Remove all breakpoints when formatting mode is changed.

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

> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:346
> +        if (callback)

Why did you make this call synchronous?

> Source/WebCore/inspector/front-end/ScriptsPanel.js:478
> +        for (var id in this._sourceFileIdToSourceFrame) {

Is this change related?
Comment 5 Pavel Podivilov 2011-04-29 04:26:38 PDT
(In reply to comment #4)
> (From update of attachment 91485 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=91485&action=review
> 
> > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:346
> > +        if (callback)
> 
> Why did you make this call synchronous?

Right after the call to WebInspector.debuggerModel.removeBreakpoint breakpoint is left in inconsistent state - it still have debuggerId. After dpm.reset breakpoint will be in that state forever. 
From the other side, since the order of calls is preserved, the calls are effectively synchronous, and it is safe to ignore the callback here.

> 
> > Source/WebCore/inspector/front-end/ScriptsPanel.js:478
> > +        for (var id in this._sourceFileIdToSourceFrame) {
> 
> Is this change related?

It's a drive-by fix for minor problem with source frames that are loaded too late (after reset when there are no source files).
Comment 6 Pavel Podivilov 2011-04-29 04:36:23 PDT
Committed r85315: <http://trac.webkit.org/changeset/85315>
Comment 7 Pavel Podivilov 2011-04-29 06:15:58 PDT
Committed r85321: <http://trac.webkit.org/changeset/85321>