Bug 215364 - Web Inspector: breakpoint condition should be evaluated before the ignore count
Summary: Web Inspector: breakpoint condition should be evaluated before the ignore count
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: 215362
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-11 02:54 PDT by Devin Rousso
Modified: 2020-08-25 11:50 PDT (History)
10 users (show)

See Also:


Attachments
Patch (7.16 KB, patch)
2020-08-21 18:53 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (7.53 KB, patch)
2020-08-25 10:52 PDT, 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 2020-08-11 02:54:09 PDT
It seems very odd to me that the hit count is incremented without checking whether or not the condition matches.

As an example, <https://webkit.org/b/215362> adds the ability for event breakpoints to be configured, meaning that the All Events breakpoint could be configured with a `window.event.type.includes("key")` condition and an ignore count of 2.  There are two ways this can be interpreted
 a) ignore the first two events (whatever they may be) and then break on every event that includes "key"
 b) pause on all but the first two "key" events
I think that (b) is much preferred and more intuitive/useful.

additionally, in the frontend UI, the condition input is above the ignore count input
Comment 1 Radar WebKit Bug Importer 2020-08-18 02:55:15 PDT
<rdar://problem/67310703>
Comment 2 Devin Rousso 2020-08-21 18:53:16 PDT
Created attachment 407039 [details]
Patch
Comment 3 Joseph Pecoraro 2020-08-25 10:35:24 PDT
Comment on attachment 407039 [details]
Patch

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

r=me

> Source/JavaScriptCore/debugger/Breakpoint.cpp:78
> +    return debugger.evaluateBreakpointCondition(*this, globalObject) && ++m_hitCount > m_ignoreCount;

I find this one line unnecessarily complicated when all combined on one line. I'd break it up kinda like it was before
Comment 4 Devin Rousso 2020-08-25 10:52:46 PDT
Created attachment 407209 [details]
Patch
Comment 5 EWS 2020-08-25 11:50:01 PDT
Committed r266138: <https://trac.webkit.org/changeset/266138>

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