Bug 235274 - Web Inspector: add a switch to control whether breakpoint evaluations (condition, ignore count, actions) are also affected by script blackboxing
Summary: Web Inspector: add a switch to control whether breakpoint evaluations (condit...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks: 237936
  Show dependency treegraph
 
Reported: 2022-01-15 14:51 PST by Devin Rousso
Modified: 2022-03-15 19:05 PDT (History)
11 users (show)

See Also:


Attachments
Patch (54.35 KB, patch)
2022-01-15 14:53 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (53.59 KB, patch)
2022-01-15 14:59 PST, Devin Rousso
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (54.48 KB, patch)
2022-01-15 15:03 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (35.07 KB, patch)
2022-01-15 18:28 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (54.74 KB, patch)
2022-01-21 15:17 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (55.56 KB, patch)
2022-02-04 16:43 PST, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2022-01-15 14:51:51 PST
being able to defer breakpoint evaluations until the next actual pause can sometimes be far more useful than doing the breakpoint evaluations at the breakpoint's original location
Comment 1 Devin Rousso 2022-01-15 14:53:36 PST
Created attachment 449273 [details]
Patch
Comment 2 EWS Watchlist 2022-01-15 14:54:43 PST
This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Comment 3 Devin Rousso 2022-01-15 14:59:03 PST
Created attachment 449274 [details]
Patch
Comment 4 Devin Rousso 2022-01-15 15:03:17 PST
Created attachment 449275 [details]
Patch
Comment 5 Devin Rousso 2022-01-15 18:28:46 PST Comment hidden (obsolete)
Comment 6 Devin Rousso 2022-01-15 18:32:03 PST Comment hidden (obsolete)
Comment 7 Devin Rousso 2022-01-21 15:11:17 PST
Comment on attachment 449275 [details]
Patch

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

> Source/JavaScriptCore/debugger/Debugger.cpp:884
>      bool pauseNow = m_pauseAtNextOpportunity;

I think this might need to be updated to include `m_pauseOnStepNext` and `m_pauseOnStepOut` (and maybe `m_pauseOnCallFrame` for Step out) as possible signals to `pauseNow` as well.  We should also probably only consider `m_pauseAtNextOpportunity` if we're not `m_afterBlackboxedScript` either.  That's the only way for sure to know if we're stepping vs pausing because of a breakpoint.

We shouldn't have to worry about things like "Continue to location" because that breakpoint is not configurable, and therefore can't be marked as auto-continue.
Comment 8 Devin Rousso 2022-01-21 15:17:31 PST
Created attachment 449700 [details]
Patch
Comment 9 Radar WebKit Bug Importer 2022-01-22 14:52:16 PST
<rdar://problem/87930496>
Comment 10 Patrick Angle 2022-01-31 15:29:04 PST
Comment on attachment 449700 [details]
Patch

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

Frontend changes LGTM with a nit and a question. Backend changes also look good to me, but is outside of my comfort zone to "r+".

> Source/JavaScriptCore/debugger/Debugger.cpp:890
> +        if (!afterBlackboxedScript)
> +            didPauseForStep = true;

Nit: `didPauseForStep = !afterBlackboxedScript;`?

> Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:1265
> +        // COMPATIBILITY (iOS 15): Debugger.setBlackboxBreakpointEvaluations did not exist yet.

Nit: "iOS 15.4"

> Source/WebInspectorUI/UserInterface/Views/BlackboxSettingsView.js:113
> +        let blackboxBreakpointEvaluationsExplanationCheckbox = blackboxBreakpointEvaluationsExplanationLabel.appendChild(document.createElement("input"));

Not sure if there is a precedent for what I'm about to suggest, but we should consider not showing this option when inspecting a pre-iOS 15.4 target. It might be a bit odd for this setting to only sometimes be here, but if someone is using the setting they might be more confused if the setting is here but doesn't do anything. At least if the setting they previously toggled while inspecting a different target is not there in an instance targeting a pre-iOS 15.4 debuggable it might provide a better clue as to why breakpoints aren't working they way the user might have expected. Thoughts?
Comment 11 Devin Rousso 2022-02-04 16:34:43 PST
Comment on attachment 449700 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Views/BlackboxSettingsView.js:113
>> +        let blackboxBreakpointEvaluationsExplanationCheckbox = blackboxBreakpointEvaluationsExplanationLabel.appendChild(document.createElement("input"));
> 
> Not sure if there is a precedent for what I'm about to suggest, but we should consider not showing this option when inspecting a pre-iOS 15.4 target. It might be a bit odd for this setting to only sometimes be here, but if someone is using the setting they might be more confused if the setting is here but doesn't do anything. At least if the setting they previously toggled while inspecting a different target is not there in an instance targeting a pre-iOS 15.4 debuggable it might provide a better clue as to why breakpoints aren't working they way the user might have expected. Thoughts?

Oh wow oops yeah I totally forgot to add a compatibility guard 🤦‍♂️  Good catch!
Comment 12 Devin Rousso 2022-02-04 16:43:46 PST
Created attachment 450950 [details]
Patch
Comment 13 Patrick Angle 2022-03-01 16:42:43 PST
Comment on attachment 450950 [details]
Patch

I've re-reviewed since you've been having trouble finding a reviewer. rs=me.
Comment 14 EWS 2022-03-01 22:43:42 PST
Committed r290720 (247967@main): <https://commits.webkit.org/247967@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450950 [details].