Changeset 266138 in webkit


Ignore:
Timestamp:
Aug 25, 2020 11:49:57 AM (4 years ago)
Author:
Devin Rousso
Message:

Web Inspector: breakpoint condition should be evaluated before the ignore count
https://bugs.webkit.org/show_bug.cgi?id=215364
<rdar://problem/67310703>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Previously, when pausing, JSC::Breakpoint would check that it's ignoreCount before it
would even attempt to evaluate it's condition. This meant that a JSC::Breakpoint with
a condition of foo === 42 and an ignoreCount of 3 would ignore the first three
pauses and then only pause if foo === 42. This is likely contrary to the expectation of
most users (especially since the condition input is before the ignoreCount input in
the Web Inspector frontend UI) in that they would probably expect to ignore the first
three pauses if foo === 42.

  • debugger/Breakpoint.cpp:

(JSC::Breakpoint::shouldPause):

LayoutTests:

  • inspector/debugger/resources/condition-ignoreCount.js: Added.

(trigger): Added.

  • inspector/debugger/setBreakpoint-condition-ignoreCount.html: Added.
  • inspector/debugger/setBreakpoint-condition-ignoreCount-expected.txt: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r266137 r266138  
     12020-08-25  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: breakpoint condition should be evaluated before the ignore count
     4        https://bugs.webkit.org/show_bug.cgi?id=215364
     5        <rdar://problem/67310703>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * inspector/debugger/resources/condition-ignoreCount.js: Added.
     10        (trigger): Added.
     11        * inspector/debugger/setBreakpoint-condition-ignoreCount.html: Added.
     12        * inspector/debugger/setBreakpoint-condition-ignoreCount-expected.txt: Added.
     13
    1142020-08-25  Hector Lopez  <hector_i_lopez@apple.com>
    215
  • trunk/Source/JavaScriptCore/ChangeLog

    r266117 r266138  
     12020-08-25  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: breakpoint condition should be evaluated before the ignore count
     4        https://bugs.webkit.org/show_bug.cgi?id=215364
     5        <rdar://problem/67310703>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Previously, when pausing, `JSC::Breakpoint` would check that it's `ignoreCount` before it
     10        would even attempt to evaluate it's `condition`. This meant that a `JSC::Breakpoint` with
     11        a `condition` of `foo === 42` and an `ignoreCount` of `3` would ignore the first three
     12        pauses and then only pause if `foo === 42`. This is likely contrary to the expectation of
     13        most users (especially since the `condition` input is before the `ignoreCount` input in
     14        the Web Inspector frontend UI) in that they would probably expect to ignore the first
     15        three pauses if `foo === 42`.
     16
     17        * debugger/Breakpoint.cpp:
     18        (JSC::Breakpoint::shouldPause):
     19
    1202020-08-25  Alexey Shvayka  <shvaikalesh@gmail.com>
    221
  • trunk/Source/JavaScriptCore/debugger/Breakpoint.cpp

    r266074 r266138  
    7676bool Breakpoint::shouldPause(Debugger& debugger, JSGlobalObject* globalObject)
    7777{
    78     if (++m_hitCount <= m_ignoreCount)
     78    if (!debugger.evaluateBreakpointCondition(*this, globalObject))
    7979        return false;
    8080
    81     return debugger.evaluateBreakpointCondition(*this, globalObject);
     81    return ++m_hitCount > m_ignoreCount;
    8282}
    8383
Note: See TracChangeset for help on using the changeset viewer.