Changeset 260113 in webkit


Ignore:
Timestamp:
Apr 14, 2020 7:35:04 PM (4 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Debugger: add a Step next that steps by expression
https://bugs.webkit.org/show_bug.cgi?id=210324

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Step next is a hybrid of Step over and Step into which continues execution to the next pause
opportunity within the current (or ancestor) call frame. It is especially useful when trying
to debug minified code, such as trying to continue to c() in a() && b() && c();, where
Step over would continue to the next statement (i.e. after the ;) and Step in would
continue to the first line inside a() (and would require a Step out to get back).

  • inspector/protocol/Debugger.json:
  • inspector/agents/InspectorDebuggerAgent.h:
  • inspector/agents/InspectorDebuggerAgent.cpp:

(Inspector::InspectorDebuggerAgent::stepNext): Added.

  • debugger/Debugger.h:
  • debugger/Debugger.cpp:

(JSC::Debugger::stepNextExpression): Added.
(JSC::Debugger::atExpression):
(JSC::Debugger::clearNextPauseState):

Source/WebInspectorUI:

Step next is a hybrid of Step over and Step into which continues execution to the next pause
opportunity within the current (or ancestor) call frame. It is especially useful when trying
to debug minified code, such as trying to continue to c() in a() && b() && c();, where
Step over would continue to the next statement (i.e. after the ;) and Step in would
continue to the first line inside a() (and would require a Step out to get back).

  • UserInterface/Controllers/DebuggerManager.js:

(WI.DebuggerManager.prototype.stepNext): Added.

  • UserInterface/Base/Main.js:

(WI.contentLoaded):
(WI.debuggerStepNext): Added.

  • UserInterface/Views/SourcesNavigationSidebarPanel.js:

(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Images/StepNext.svg: Added.

LayoutTests:

  • inspector/debugger/stepping/stepNext.html: Added.
  • inspector/debugger/stepping/stepNext-expected.txt: Added.
  • inspector/debugger/stepping/stepInto.html:
  • inspector/debugger/stepping/stepInto-expected.txt:
  • inspector/debugger/stepping/stepOut.html:
  • inspector/debugger/stepping/stepOut-expected.txt:
  • inspector/debugger/stepping/stepOver.html:
  • inspector/debugger/stepping/stepOver-expected.txt:

Renamed functions for clarity and added additional test cases from other commands.

Location:
trunk
Files:
1 added
18 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r260097 r260113  
     12020-04-14  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Debugger: add a Step next that steps by expression
     4        https://bugs.webkit.org/show_bug.cgi?id=210324
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * inspector/debugger/stepping/stepNext.html: Added.
     9        * inspector/debugger/stepping/stepNext-expected.txt: Added.
     10
     11        * inspector/debugger/stepping/stepInto.html:
     12        * inspector/debugger/stepping/stepInto-expected.txt:
     13        * inspector/debugger/stepping/stepOut.html:
     14        * inspector/debugger/stepping/stepOut-expected.txt:
     15        * inspector/debugger/stepping/stepOver.html:
     16        * inspector/debugger/stepping/stepOver-expected.txt:
     17        Renamed functions for clarity and added additional test cases from other commands.
     18
    1192020-04-14  Diego Pino Garcia  <dpino@igalia.com>
    220
  • trunk/LayoutTests/inspector/debugger/stepping/stepInto-expected.txt

    r206652 r260113  
    1 ALERT: log 1
    21Checking pause locations when stepping with "stepInto".
    32
     
    65-- Running test case: Debugger.stepInto.statements
    76PAUSED (debugger-statement)
    8 PAUSE AT entry1:12:5
    9       8    }
    10       9   
    11      10    function entry1() {
     7PAUSE AT testStatements:12:5
     8      8    function c() { return "c"; }
     9      9   
     10     10    function testStatements() {
    1211 ->  11        |debugger;
    1312     12        let x = 1;
     
    1514     14    }
    1615
    17 PAUSE AT entry1:13:5
    18       9   
    19      10    function entry1() {
     16PAUSE AT testStatements:13:5
     17      9   
     18     10    function testStatements() {
    2019     11        debugger;
    2120 ->  12        |let x = 1;
     
    2423     15   
    2524
    26 PAUSE AT entry1:14:5
    27      10    function entry1() {
     25PAUSE AT testStatements:14:5
     26     10    function testStatements() {
    2827     11        debugger;
    2928     12        let x = 1;
     
    3130     14    }
    3231     15   
    33      16    function entry2() {
    34 
    35 PAUSE AT entry1:15:2
     32     16    function testFunctions() {
     33
     34PAUSE AT testStatements:15:2
    3635     11        debugger;
    3736     12        let x = 1;
     
    3938 ->  14    }|
    4039     15   
    41      16    function entry2() {
     40     16    function testFunctions() {
    4241     17        debugger;
    4342
     
    4645-- Running test case: Debugger.stepInto.function
    4746PAUSED (debugger-statement)
    48 PAUSE AT entry2:18:5
     47PAUSE AT testFunctions:18:5
    4948     14    }
    5049     15   
    51      16    function entry2() {
     50     16    function testFunctions() {
    5251 ->  17        |debugger;
    5352     18        let before = 1;
    54      19        testAlert("log 1");
     53     19        a();
    5554     20        let after = 2;
    5655
    57 PAUSE AT entry2:19:5
     56PAUSE AT testFunctions:19:5
    5857     15   
    59      16    function entry2() {
     58     16    function testFunctions() {
    6059     17        debugger;
    6160 ->  18        |let before = 1;
    62      19        testAlert("log 1");
     61     19        a();
    6362     20        let after = 2;
    6463     21    }
    6564
    66 PAUSE AT entry2:20:5
    67      16    function entry2() {
     65PAUSE AT testFunctions:20:5
     66     16    function testFunctions() {
    6867     17        debugger;
    6968     18        let before = 1;
    70  ->  19        |testAlert("log 1");
     69 ->  19        |a();
    7170     20        let after = 2;
    7271     21    }
    7372     22   
    7473
    75 PAUSE AT testAlert:8:5
    76       4    <script src="../resources/log-pause-location.js"></script>
    77       5    <script>
    78       6    function testAlert(str) {
    79  ->   7        |alert(str);
    80       8    }
    81       9   
    82      10    function entry1() {
    83 
    84 PAUSE AT testAlert:9:2
    85       5    <script>
    86       6    function testAlert(str) {
    87       7        alert(str);
    88  ->   8    }|
    89       9   
    90      10    function entry1() {
    91      11        debugger;
    92 
    93 PAUSE AT entry2:21:5
     74PAUSE AT a:7:16
     75      3    <script src="../../../http/tests/inspector/resources/inspector-test.js"></script>
     76      4    <script src="../resources/log-pause-location.js"></script>
     77      5    <script>
     78 ->   6    function a() { |return "a"; }
     79      7    function b() { return "b"; }
     80      8    function c() { return "c"; }
     81      9   
     82
     83PAUSE AT a:7:29
     84      3    <script src="../../../http/tests/inspector/resources/inspector-test.js"></script>
     85      4    <script src="../resources/log-pause-location.js"></script>
     86      5    <script>
     87 ->   6    function a() { return "a"; }|
     88      7    function b() { return "b"; }
     89      8    function c() { return "c"; }
     90      9   
     91
     92PAUSE AT testFunctions:21:5
    9493     17        debugger;
    9594     18        let before = 1;
    96      19        testAlert("log 1");
     95     19        a();
    9796 ->  20        |let after = 2;
    9897     21    }
    9998     22   
    100      23    function entry3() {
    101 
    102 PAUSE AT entry2:22:2
     99     23    function testEval() {
     100
     101PAUSE AT testFunctions:22:2
    103102     18        let before = 1;
    104      19        testAlert("log 1");
     103     19        a();
    105104     20        let after = 2;
    106105 ->  21    }|
    107106     22   
    108      23    function entry3() {
     107     23    function testEval() {
    109108     24        debugger;
    110109
     
    113112-- Running test case: Debugger.stepInto.eval
    114113PAUSED (debugger-statement)
    115 PAUSE AT entry3:25:5
     114PAUSE AT testEval:25:5
    116115     21    }
    117116     22   
    118      23    function entry3() {
     117     23    function testEval() {
    119118 ->  24        |debugger;
    120119     25        let before = 1;
     
    122121     27        let after = 2;
    123122
    124 PAUSE AT entry3:26:5
     123PAUSE AT testEval:26:5
    125124     22   
    126      23    function entry3() {
     125     23    function testEval() {
    127126     24        debugger;
    128127 ->  25        |let before = 1;
     
    131130     28    }
    132131
    133 PAUSE AT entry3:27:5
    134      23    function entry3() {
     132PAUSE AT testEval:27:5
     133     23    function testEval() {
    135134     24        debugger;
    136135     25        let before = 1;
     
    146145--- Source Unavailable ---
    147146
    148 PAUSE AT entry3:28:5
     147PAUSE AT testEval:28:5
    149148     24        debugger;
    150149     25        let before = 1;
     
    153152     28    }
    154153     29   
    155      30    function entry4() {
    156 
    157 PAUSE AT entry3:29:2
     154     30    function testInnerFunction() {
     155
     156PAUSE AT testEval:29:2
    158157     25        let before = 1;
    159158     26        eval("1 + 1");
     
    161160 ->  28    }|
    162161     29   
    163      30    function entry4() {
     162     30    function testInnerFunction() {
    164163     31        (function() {
    165164
     
    170169PAUSE AT <anonymous>:33:9
    171170     29   
    172      30    function entry4() {
     171     30    function testInnerFunction() {
    173172     31        (function() {
    174173 ->  32            |debugger;
     
    178177
    179178PAUSE AT <anonymous>:34:9
    180      30    function entry4() {
     179     30    function testInnerFunction() {
    181180     31        (function() {
    182181     32            debugger;
     
    195194     37   
    196195
    197 PAUSE AT entry4:36:5
     196PAUSE AT testInnerFunction:36:5
    198197     32            debugger;
    199198     33            let inner = 1;
     
    202201     36    }
    203202     37   
    204      38    // ---------
    205 
    206 PAUSE AT entry4:37:2
     203     38    function testCommas() {
     204
     205PAUSE AT testInnerFunction:37:2
    207206     33            let inner = 1;
    208207     34        })();
     
    210209 ->  36    }|
    211210     37   
    212      38    // ---------
    213      39   
     211     38    function testCommas() {
     212     39        debugger;
    214213
    215214RESUMED
    216215
     216-- Running test case: Debugger.stepInto.commas
     217PAUSED (debugger-statement)
     218PAUSE AT testCommas:40:5
     219     36    }
     220     37   
     221     38    function testCommas() {
     222 ->  39        |debugger;
     223     40        let x = 1,
     224     41            y = 2,
     225     42            z = 3;
     226
     227PAUSE AT testCommas:41:5
     228     37   
     229     38    function testCommas() {
     230     39        debugger;
     231 ->  40        |let x = 1,
     232     41            y = 2,
     233     42            z = 3;
     234     43        a(), b(), c();
     235
     236PAUSE AT testCommas:42:9
     237     38    function testCommas() {
     238     39        debugger;
     239     40        let x = 1,
     240 ->  41            |y = 2,
     241     42            z = 3;
     242     43        a(), b(), c();
     243     44        true && (a(), b(), c());
     244
     245PAUSE AT testCommas:43:9
     246     39        debugger;
     247     40        let x = 1,
     248     41            y = 2,
     249 ->  42            |z = 3;
     250     43        a(), b(), c();
     251     44        true && (a(), b(), c());
     252     45    }
     253
     254PAUSE AT testCommas:44:5
     255     40        let x = 1,
     256     41            y = 2,
     257     42            z = 3;
     258 ->  43        |a(), b(), c();
     259     44        true && (a(), b(), c());
     260     45    }
     261     46   
     262
     263PAUSE AT a:7:16
     264      3    <script src="../../../http/tests/inspector/resources/inspector-test.js"></script>
     265      4    <script src="../resources/log-pause-location.js"></script>
     266      5    <script>
     267 ->   6    function a() { |return "a"; }
     268      7    function b() { return "b"; }
     269      8    function c() { return "c"; }
     270      9   
     271
     272PAUSE AT a:7:29
     273      3    <script src="../../../http/tests/inspector/resources/inspector-test.js"></script>
     274      4    <script src="../resources/log-pause-location.js"></script>
     275      5    <script>
     276 ->   6    function a() { return "a"; }|
     277      7    function b() { return "b"; }
     278      8    function c() { return "c"; }
     279      9   
     280
     281PAUSE AT testCommas:44:10
     282     40        let x = 1,
     283     41            y = 2,
     284     42            z = 3;
     285 ->  43        a(), |b(), c();
     286     44        true && (a(), b(), c());
     287     45    }
     288     46   
     289
     290PAUSE AT b:8:16
     291      4    <script src="../resources/log-pause-location.js"></script>
     292      5    <script>
     293      6    function a() { return "a"; }
     294 ->   7    function b() { |return "b"; }
     295      8    function c() { return "c"; }
     296      9   
     297     10    function testStatements() {
     298
     299PAUSE AT b:8:29
     300      4    <script src="../resources/log-pause-location.js"></script>
     301      5    <script>
     302      6    function a() { return "a"; }
     303 ->   7    function b() { return "b"; }|
     304      8    function c() { return "c"; }
     305      9   
     306     10    function testStatements() {
     307
     308PAUSE AT testCommas:44:15
     309     40        let x = 1,
     310     41            y = 2,
     311     42            z = 3;
     312 ->  43        a(), b(), |c();
     313     44        true && (a(), b(), c());
     314     45    }
     315     46   
     316
     317PAUSE AT c:9:16
     318      5    <script>
     319      6    function a() { return "a"; }
     320      7    function b() { return "b"; }
     321 ->   8    function c() { |return "c"; }
     322      9   
     323     10    function testStatements() {
     324     11        debugger;
     325
     326PAUSE AT c:9:29
     327      5    <script>
     328      6    function a() { return "a"; }
     329      7    function b() { return "b"; }
     330 ->   8    function c() { return "c"; }|
     331      9   
     332     10    function testStatements() {
     333     11        debugger;
     334
     335PAUSE AT testCommas:45:5
     336     41            y = 2,
     337     42            z = 3;
     338     43        a(), b(), c();
     339 ->  44        |true && (a(), b(), c());
     340     45    }
     341     46   
     342     47    function testChainedExpressions() {
     343
     344PAUSE AT testCommas:45:14
     345     41            y = 2,
     346     42            z = 3;
     347     43        a(), b(), c();
     348 ->  44        true && (|a(), b(), c());
     349     45    }
     350     46   
     351     47    function testChainedExpressions() {
     352
     353PAUSE AT a:7:16
     354      3    <script src="../../../http/tests/inspector/resources/inspector-test.js"></script>
     355      4    <script src="../resources/log-pause-location.js"></script>
     356      5    <script>
     357 ->   6    function a() { |return "a"; }
     358      7    function b() { return "b"; }
     359      8    function c() { return "c"; }
     360      9   
     361
     362PAUSE AT a:7:29
     363      3    <script src="../../../http/tests/inspector/resources/inspector-test.js"></script>
     364      4    <script src="../resources/log-pause-location.js"></script>
     365      5    <script>
     366 ->   6    function a() { return "a"; }|
     367      7    function b() { return "b"; }
     368      8    function c() { return "c"; }
     369      9   
     370
     371PAUSE AT testCommas:45:19
     372     41            y = 2,
     373     42            z = 3;
     374     43        a(), b(), c();
     375 ->  44        true && (a(), |b(), c());
     376     45    }
     377     46   
     378     47    function testChainedExpressions() {
     379
     380PAUSE AT b:8:16
     381      4    <script src="../resources/log-pause-location.js"></script>
     382      5    <script>
     383      6    function a() { return "a"; }
     384 ->   7    function b() { |return "b"; }
     385      8    function c() { return "c"; }
     386      9   
     387     10    function testStatements() {
     388
     389PAUSE AT b:8:29
     390      4    <script src="../resources/log-pause-location.js"></script>
     391      5    <script>
     392      6    function a() { return "a"; }
     393 ->   7    function b() { return "b"; }|
     394      8    function c() { return "c"; }
     395      9   
     396     10    function testStatements() {
     397
     398PAUSE AT testCommas:45:24
     399     41            y = 2,
     400     42            z = 3;
     401     43        a(), b(), c();
     402 ->  44        true && (a(), b(), |c());
     403     45    }
     404     46   
     405     47    function testChainedExpressions() {
     406
     407PAUSE AT c:9:16
     408      5    <script>
     409      6    function a() { return "a"; }
     410      7    function b() { return "b"; }
     411 ->   8    function c() { |return "c"; }
     412      9   
     413     10    function testStatements() {
     414     11        debugger;
     415
     416PAUSE AT c:9:29
     417      5    <script>
     418      6    function a() { return "a"; }
     419      7    function b() { return "b"; }
     420 ->   8    function c() { return "c"; }|
     421      9   
     422     10    function testStatements() {
     423     11        debugger;
     424
     425PAUSE AT testCommas:46:2
     426     42            z = 3;
     427     43        a(), b(), c();
     428     44        true && (a(), b(), c());
     429 ->  45    }|
     430     46   
     431     47    function testChainedExpressions() {
     432     48        debugger;
     433
     434RESUMED
     435
     436-- Running test case: Debugger.stepInto.chainedExpressions
     437PAUSED (debugger-statement)
     438PAUSE AT testChainedExpressions:49:5
     439     45    }
     440     46   
     441     47    function testChainedExpressions() {
     442 ->  48        |debugger;
     443     49        a() && b() && c();
     444     50    }
     445     51   
     446
     447PAUSE AT testChainedExpressions:50:5
     448     46   
     449     47    function testChainedExpressions() {
     450     48        debugger;
     451 ->  49        |a() && b() && c();
     452     50    }
     453     51   
     454     52    // ---------
     455
     456PAUSE AT a:7:16
     457      3    <script src="../../../http/tests/inspector/resources/inspector-test.js"></script>
     458      4    <script src="../resources/log-pause-location.js"></script>
     459      5    <script>
     460 ->   6    function a() { |return "a"; }
     461      7    function b() { return "b"; }
     462      8    function c() { return "c"; }
     463      9   
     464
     465PAUSE AT a:7:29
     466      3    <script src="../../../http/tests/inspector/resources/inspector-test.js"></script>
     467      4    <script src="../resources/log-pause-location.js"></script>
     468      5    <script>
     469 ->   6    function a() { return "a"; }|
     470      7    function b() { return "b"; }
     471      8    function c() { return "c"; }
     472      9   
     473
     474PAUSE AT testChainedExpressions:50:12
     475     46   
     476     47    function testChainedExpressions() {
     477     48        debugger;
     478 ->  49        a() && |b() && c();
     479     50    }
     480     51   
     481     52    // ---------
     482
     483PAUSE AT b:8:16
     484      4    <script src="../resources/log-pause-location.js"></script>
     485      5    <script>
     486      6    function a() { return "a"; }
     487 ->   7    function b() { |return "b"; }
     488      8    function c() { return "c"; }
     489      9   
     490     10    function testStatements() {
     491
     492PAUSE AT b:8:29
     493      4    <script src="../resources/log-pause-location.js"></script>
     494      5    <script>
     495      6    function a() { return "a"; }
     496 ->   7    function b() { return "b"; }|
     497      8    function c() { return "c"; }
     498      9   
     499     10    function testStatements() {
     500
     501PAUSE AT testChainedExpressions:50:19
     502     46   
     503     47    function testChainedExpressions() {
     504     48        debugger;
     505 ->  49        a() && b() && |c();
     506     50    }
     507     51   
     508     52    // ---------
     509
     510PAUSE AT c:9:16
     511      5    <script>
     512      6    function a() { return "a"; }
     513      7    function b() { return "b"; }
     514 ->   8    function c() { |return "c"; }
     515      9   
     516     10    function testStatements() {
     517     11        debugger;
     518
     519PAUSE AT c:9:29
     520      5    <script>
     521      6    function a() { return "a"; }
     522      7    function b() { return "b"; }
     523 ->   8    function c() { return "c"; }|
     524      9   
     525     10    function testStatements() {
     526     11        debugger;
     527
     528PAUSE AT testChainedExpressions:51:2
     529     47    function testChainedExpressions() {
     530     48        debugger;
     531     49        a() && b() && c();
     532 ->  50    }|
     533     51   
     534     52    // ---------
     535     53   
     536
     537RESUMED
     538
  • trunk/LayoutTests/inspector/debugger/stepping/stepInto.html

    r220119 r260113  
    55<script src="../resources/log-pause-location.js"></script>
    66<script>
    7 function testAlert(str) {
    8     alert(str);
    9 }
     7function a() { return "a"; }
     8function b() { return "b"; }
     9function c() { return "c"; }
    1010
    11 function entry1() {
     11function testStatements() {
    1212    debugger;
    1313    let x = 1;
     
    1515}
    1616
    17 function entry2() {
     17function testFunctions() {
    1818    debugger;
    1919    let before = 1;
    20     testAlert("log 1");
     20    a();
    2121    let after = 2;
    2222}
    2323
    24 function entry3() {
     24function testEval() {
    2525    debugger;
    2626    let before = 1;
     
    2929}
    3030
    31 function entry4() {
     31function testInnerFunction() {
    3232    (function() {
    3333        debugger;
     
    3535    })();
    3636    let outer = 2;
     37}
     38
     39function testCommas() {
     40    debugger;
     41    let x = 1,
     42        y = 2,
     43        z = 3;
     44    a(), b(), c();
     45    true && (a(), b(), c());
     46}
     47
     48function testChainedExpressions() {
     49    debugger;
     50    a() && b() && c();
    3751}
    3852
     
    7084        name: "Debugger.stepInto.statements",
    7185        description: "step-into should step over statements.",
    72         expression: "setTimeout(entry1)",
     86        expression: "setTimeout(testStatements)",
    7387    });
    7488
     
    7690        name: "Debugger.stepInto.function",
    7791        description: "step-into should step into function calls.",
    78         expression: "setTimeout(entry2)",
     92        expression: "setTimeout(testFunctions)",
    7993    });
    8094
     
    8296        name: "Debugger.stepInto.eval",
    8397        description: "step-into should step into an eval program.",
    84         expression: "setTimeout(entry3)",
     98        expression: "setTimeout(testEval)",
    8599    });
    86100
     
    88102        name: "Debugger.stepInto.innerFunction",
    89103        description: "step-into should step out of a function to its caller.",
    90         expression: "setTimeout(entry4)",
     104        expression: "setTimeout(testInnerFunction)",
     105    });
     106
     107    addTestCase({
     108        name: "Debugger.stepInto.commas",
     109        description: "step-into should step into each sub-expression within comma expressions.",
     110        expression: "setTimeout(testCommas)",
     111    });
     112
     113    addTestCase({
     114        name: "Debugger.stepInto.chainedExpressions",
     115        description: "step-into should step into each sub-expression within chained expressions.",
     116        expression: "setTimeout(testChainedExpressions)",
    91117    });
    92118
  • trunk/LayoutTests/inspector/debugger/stepping/stepNext-expected.txt

    r260112 r260113  
    1 Checking pause locations when stepping with "stepOver".
    2 
    3 
    4 == Running test suite: Debugger.stepOver
    5 -- Running test case: Debugger.stepOver.statements
     1Checking pause locations when stepping with "stepNext".
     2
     3
     4== Running test suite: Debugger.stepNext
     5-- Running test case: Debugger.stepNext.statements
    66PAUSED (debugger-statement)
    77PAUSE AT testStatements:12:5
    8       8    }
     8      8    function c() { return "c"; }
    99      9   
    1010     10    function testStatements() {
     
    4343RESUMED
    4444
    45 -- Running test case: Debugger.stepOver.function
     45-- Running test case: Debugger.stepNext.function
    4646PAUSED (debugger-statement)
    4747PAUSE AT testFunctions:18:5
     
    9292RESUMED
    9393
    94 -- Running test case: Debugger.stepOver.eval
     94-- Running test case: Debugger.stepNext.eval
    9595PAUSED (debugger-statement)
    9696PAUSE AT testEval:25:5
     
    128128     28    }
    129129     29   
    130      30    function testLocalFunction() {
     130     30    function testInnerFunction() {
    131131
    132132PAUSE AT testEval:29:2
     
    136136 ->  28    }|
    137137     29   
    138      30    function testLocalFunction() {
     138     30    function testInnerFunction() {
    139139     31        (function() {
    140140
    141141RESUMED
    142142
    143 -- Running test case: Debugger.stepOver.innerFunction
     143-- Running test case: Debugger.stepNext.innerFunction
    144144PAUSED (debugger-statement)
    145145PAUSE AT <anonymous>:33:9
    146146     29   
    147      30    function testLocalFunction() {
     147     30    function testInnerFunction() {
    148148     31        (function() {
    149149 ->  32            |debugger;
     
    153153
    154154PAUSE AT <anonymous>:34:9
    155      30    function testLocalFunction() {
     155     30    function testInnerFunction() {
    156156     31        (function() {
    157157     32            debugger;
     
    170170     37   
    171171
    172 PAUSE AT testLocalFunction:36:5
     172PAUSE AT testInnerFunction:36:5
    173173     32            debugger;
    174174     33            let inner = 1;
     
    179179     38    function testCommas() {
    180180
    181 PAUSE AT testLocalFunction:37:2
     181PAUSE AT testInnerFunction:37:2
    182182     33            let inner = 1;
    183183     34        })();
     
    190190RESUMED
    191191
    192 -- Running test case: Debugger.stepOver.commas
     192-- Running test case: Debugger.stepNext.commas
    193193PAUSED (debugger-statement)
    194194PAUSE AT testCommas:40:5
     
    262262     45    }
    263263     46   
    264      47    function a() { }
     264     47    function testChainedExpressions() {
    265265
    266266PAUSE AT testCommas:45:14
     
    271271     45    }
    272272     46   
    273      47    function a() { }
     273     47    function testChainedExpressions() {
    274274
    275275PAUSE AT testCommas:45:19
     
    280280     45    }
    281281     46   
    282      47    function a() { }
     282     47    function testChainedExpressions() {
    283283
    284284PAUSE AT testCommas:45:24
     
    289289     45    }
    290290     46   
    291      47    function a() { }
     291     47    function testChainedExpressions() {
    292292
    293293PAUSE AT testCommas:46:2
     
    297297 ->  45    }|
    298298     46   
    299      47    function a() { }
    300      48    function b() { }
    301 
    302 RESUMED
    303 
     299     47    function testChainedExpressions() {
     300     48        debugger;
     301
     302RESUMED
     303
     304-- Running test case: Debugger.stepNext.chainedExpressions
     305PAUSED (debugger-statement)
     306PAUSE AT testChainedExpressions:49:5
     307     45    }
     308     46   
     309     47    function testChainedExpressions() {
     310 ->  48        |debugger;
     311     49        a() && b() && c();
     312     50    }
     313     51   
     314
     315PAUSE AT testChainedExpressions:50:5
     316     46   
     317     47    function testChainedExpressions() {
     318     48        debugger;
     319 ->  49        |a() && b() && c();
     320     50    }
     321     51   
     322     52    // ---------
     323
     324PAUSE AT testChainedExpressions:50:12
     325     46   
     326     47    function testChainedExpressions() {
     327     48        debugger;
     328 ->  49        a() && |b() && c();
     329     50    }
     330     51   
     331     52    // ---------
     332
     333PAUSE AT testChainedExpressions:50:19
     334     46   
     335     47    function testChainedExpressions() {
     336     48        debugger;
     337 ->  49        a() && b() && |c();
     338     50    }
     339     51   
     340     52    // ---------
     341
     342PAUSE AT testChainedExpressions:51:2
     343     47    function testChainedExpressions() {
     344     48        debugger;
     345     49        a() && b() && c();
     346 ->  50    }|
     347     51   
     348     52    // ---------
     349     53   
     350
     351RESUMED
     352
  • trunk/LayoutTests/inspector/debugger/stepping/stepNext.html

    r260112 r260113  
    55<script src="../resources/log-pause-location.js"></script>
    66<script>
    7 function testAlert(str) {
    8     alert(str);
    9 }
     7function a() { return "a"; }
     8function b() { return "b"; }
     9function c() { return "c"; }
    1010
    1111function testStatements() {
     
    2929}
    3030
    31 function testLocalFunction() {
     31function testInnerFunction() {
    3232    (function() {
    3333        debugger;
     
    4646}
    4747
    48 function a() { }
    49 function b() { }
    50 function c() { }
     48function testChainedExpressions() {
     49    debugger;
     50    a() && b() && c();
     51}
    5152
    5253// ---------
     
    5455function test()
    5556{
    56     let suite = InspectorTest.createAsyncSuite("Debugger.stepOver");
     57    let suite = InspectorTest.createAsyncSuite("Debugger.stepNext");
    5758
    58     // Always step-over when call frames change.
     59    // Always step-next when call frames change.
    5960    WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.CallFramesDidChange, (event) => {
    6061        if (!WI.debuggerManager.activeCallFrame)
    6162            return;
    6263        logPauseLocation();
    63         WI.debuggerManager.stepOver();
     64        WI.debuggerManager.stepNext();
    6465    });
    6566
     
    8182
    8283    addTestCase({
    83         name: "Debugger.stepOver.statements",
    84         description: "step-over should step over statements.",
     84        name: "Debugger.stepNext.statements",
     85        description: "step-next should step over statements.",
    8586        expression: "setTimeout(testStatements)",
    8687    });
    8788
    8889    addTestCase({
    89         name: "Debugger.stepOver.function",
    90         description: "step-over should step over function calls.",
     90        name: "Debugger.stepNext.function",
     91        description: "step-next should step over function calls.",
    9192        expression: "setTimeout(testFunctions)",
    9293    });
    9394
    9495    addTestCase({
    95         name: "Debugger.stepOver.eval",
    96         description: "step-over should step over an eval program.",
     96        name: "Debugger.stepNext.eval",
     97        description: "step-next should step over an eval program.",
    9798        expression: "setTimeout(testEval)",
    9899    });
    99100
    100101    addTestCase({
    101         name: "Debugger.stepOver.innerFunction",
    102         description: "step-over should step out of a function to its caller.",
    103         expression: "setTimeout(testLocalFunction)",
     102        name: "Debugger.stepNext.innerFunction",
     103        description: "step-next should step out of a function to its caller.",
     104        expression: "setTimeout(testInnerFunction)",
    104105    });
    105106
    106107    addTestCase({
    107         name: "Debugger.stepOver.commas",
    108         description: "step-over should step over comma expressions, treating them as statements.",
     108        name: "Debugger.stepNext.commas",
     109        description: "step-next should step to each sub-expression within comma expressions.",
    109110        expression: "setTimeout(testCommas)",
     111    });
     112
     113    addTestCase({
     114        name: "Debugger.stepNext.chainedExpressions",
     115        description: "step-next should step to each sub-expression within chained expressions.",
     116        expression: "setTimeout(testChainedExpressions)",
    110117    });
    111118
     
    117124</head>
    118125<body onload="runTest()">
    119 <p>Checking pause locations when stepping with "stepOver".</p>
     126<p>Checking pause locations when stepping with "stepNext".</p>
    120127</body>
    121128</html>
  • trunk/LayoutTests/inspector/debugger/stepping/stepOut-expected.txt

    r206652 r260113  
    55-- Running test case: Debugger.stepOut.function
    66PAUSED (debugger-statement)
    7 PAUSE AT entry1:8:5
    8       4    <script src="../resources/log-pause-location.js"></script>
    9       5    <script>
    10       6    function entry1() {
    11  ->   7        |debugger;
    12       8        let x = 1;
    13       9        let y = 2;
    14      10    }
     7PAUSE AT testFunctions:12:5
     8      8    function c() { return "c"; }
     9      9   
     10     10    function testFunctions() {
     11 ->  11        |debugger;
     12     12        let x = 1;
     13     13        let y = 2;
     14     14    }
    1515
    1616RESUMED
     
    2525-- Running test case: Debugger.stepOut.innerFunction
    2626PAUSED (debugger-statement)
    27 PAUSE AT beta:24:9
    28      20            beta();
    29      21        }
    30      22        function beta() {
    31  ->  23            |debugger;
    32      24        }
    33      25        alpha();
    34      26    }
     27PAUSE AT beta:28:9
     28     24            beta();
     29     25        }
     30     26        function beta() {
     31 ->  27            |debugger;
     32     28        }
     33     29        alpha();
     34     30    }
    3535
    36 PAUSE AT alpha:22:6
    37      18    function entry3() {
    38      19        function alpha() {
    39      20            beta();
    40  ->  21        }|
    41      22        function beta() {
    42      23            debugger;
    43      24        }
     36PAUSE AT alpha:26:6
     37     22    function testInnerFunction() {
     38     23        function alpha() {
     39     24            beta();
     40 ->  25        }|
     41     26        function beta() {
     42     27            debugger;
     43     28        }
    4444
    45 PAUSE AT entry3:27:2
    46      23            debugger;
    47      24        }
    48      25        alpha();
    49  ->  26    }|
    50      27   
    51      28    function entry4() {
    52      29        (function() {
     45PAUSE AT testInnerFunction:31:2
     46     27            debugger;
     47     28        }
     48     29        alpha();
     49 ->  30    }|
     50     31   
     51     32    function testAnonymousFunction() {
     52     33        (function() {
    5353
    5454RESUMED
     
    5656-- Running test case: Debugger.stepOut.anonymousFunction
    5757PAUSED (debugger-statement)
    58 PAUSE AT <anonymous>:31:9
    59      27   
    60      28    function entry4() {
    61      29        (function() {
    62  ->  30            |debugger;
    63      31            let inner = 1;
    64      32        })();
    65      33        let outer = 2;
     58PAUSE AT <anonymous>:35:9
     59     31   
     60     32    function testAnonymousFunction() {
     61     33        (function() {
     62 ->  34            |debugger;
     63     35            let inner = 1;
     64     36        })();
     65     37        let outer = 2;
    6666
    67 PAUSE AT entry4:34:5
    68      30            debugger;
    69      31            let inner = 1;
    70      32        })();
    71  ->  33        |let outer = 2;
    72      34    }
    73      35   
    74      36    // ---------
     67PAUSE AT testAnonymousFunction:38:5
     68     34            debugger;
     69     35            let inner = 1;
     70     36        })();
     71 ->  37        |let outer = 2;
     72     38    }
     73     39   
     74     40    function testCommas() {
    7575
    7676RESUMED
    7777
     78-- Running test case: Debugger.stepOut.commas
     79PAUSED (debugger-statement)
     80PAUSE AT testCommas:42:5
     81     38    }
     82     39   
     83     40    function testCommas() {
     84 ->  41        |debugger;
     85     42        let x = 1,
     86     43            y = 2,
     87     44            z = 3;
     88
     89RESUMED
     90
     91-- Running test case: Debugger.stepOut.chainedExpressions
     92PAUSED (debugger-statement)
     93PAUSE AT testChainedExpressions:51:5
     94     47    }
     95     48   
     96     49    function testChainedExpressions() {
     97 ->  50        |debugger;
     98     51        a() && b() && c();
     99     52    }
     100     53   
     101
     102RESUMED
     103
  • trunk/LayoutTests/inspector/debugger/stepping/stepOut.html

    r220119 r260113  
    55<script src="../resources/log-pause-location.js"></script>
    66<script>
    7 function entry1() {
     7function a() { return "a"; }
     8function b() { return "b"; }
     9function c() { return "c"; }
     10
     11function testFunctions() {
    812    debugger;
    913    let x = 1;
     
    1115}
    1216
    13 function entry2() {
     17function testEval() {
    1418    let before = 1;
    1519    eval("debugger");
     
    1721}
    1822
    19 function entry3() {
     23function testInnerFunction() {
    2024    function alpha() {
    2125        beta();
     
    2731}
    2832
    29 function entry4() {
     33function testAnonymousFunction() {
    3034    (function() {
    3135        debugger;
     
    3337    })();
    3438    let outer = 2;
     39}
     40
     41function testCommas() {
     42    debugger;
     43    let x = 1,
     44        y = 2,
     45        z = 3;
     46    a(), b(), c();
     47    true && (a(), b(), c());
     48}
     49
     50function testChainedExpressions() {
     51    debugger;
     52    a() && b() && c();
    3553}
    3654
     
    6886        name: "Debugger.stepOut.function",
    6987        description: "step-out should leave a function.",
    70         expression: "setTimeout(entry1)",
     88        expression: "setTimeout(testFunctions)",
    7189    });
    7290
     
    7492        name: "Debugger.stepOut.eval",
    7593        description: "step-out should step leave an eval program.",
    76         expression: "setTimeout(entry2)",
     94        expression: "setTimeout(testEval)",
    7795    });
    7896
     
    8098        name: "Debugger.stepOut.innerFunction",
    8199        description: "step-out should leave a function and end up after its callsite.",
    82         expression: "setTimeout(entry3)",
     100        expression: "setTimeout(testInnerFunction)",
    83101    });
    84102
     
    86104        name: "Debugger.stepOut.anonymousFunction",
    87105        description: "step-out should leave an anonymous function and end up after its callsite.",
    88         expression: "setTimeout(entry4)",
     106        expression: "setTimeout(testAnonymousFunction)",
     107    });
     108
     109    addTestCase({
     110        name: "Debugger.stepOut.commas",
     111        description: "step-out should not enter any comma separated function calls.",
     112        expression: "setTimeout(testCommas)",
     113    });
     114
     115    addTestCase({
     116        name: "Debugger.stepOut.chainedExpressions",
     117        description: "step-out should not enter any function calls in a chained expression.",
     118        expression: "setTimeout(testChainedExpressions)",
    89119    });
    90120
  • trunk/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt

    r259810 r260113  
    66PAUSED (debugger-statement)
    77PAUSE AT testStatements:12:5
    8       8    }
     8      8    function c() { return "c"; }
    99      9   
    1010     10    function testStatements() {
     
    128128     28    }
    129129     29   
    130      30    function testLocalFunction() {
     130     30    function testInnerFunction() {
    131131
    132132PAUSE AT testEval:29:2
     
    136136 ->  28    }|
    137137     29   
    138      30    function testLocalFunction() {
     138     30    function testInnerFunction() {
    139139     31        (function() {
    140140
     
    145145PAUSE AT <anonymous>:33:9
    146146     29   
    147      30    function testLocalFunction() {
     147     30    function testInnerFunction() {
    148148     31        (function() {
    149149 ->  32            |debugger;
     
    153153
    154154PAUSE AT <anonymous>:34:9
    155      30    function testLocalFunction() {
     155     30    function testInnerFunction() {
    156156     31        (function() {
    157157     32            debugger;
     
    170170     37   
    171171
    172 PAUSE AT testLocalFunction:36:5
     172PAUSE AT testInnerFunction:36:5
    173173     32            debugger;
    174174     33            let inner = 1;
     
    179179     38    function testCommas() {
    180180
    181 PAUSE AT testLocalFunction:37:2
     181PAUSE AT testInnerFunction:37:2
    182182     33            let inner = 1;
    183183     34        })();
     
    262262     45    }
    263263     46   
    264      47    function a() { }
     264     47    function testChainedExpressions() {
    265265
    266266PAUSE AT testCommas:45:14
     
    271271     45    }
    272272     46   
    273      47    function a() { }
     273     47    function testChainedExpressions() {
    274274
    275275PAUSE AT testCommas:45:19
     
    280280     45    }
    281281     46   
    282      47    function a() { }
     282     47    function testChainedExpressions() {
    283283
    284284PAUSE AT testCommas:45:24
     
    289289     45    }
    290290     46   
    291      47    function a() { }
     291     47    function testChainedExpressions() {
    292292
    293293PAUSE AT testCommas:46:2
     
    297297 ->  45    }|
    298298     46   
    299      47    function a() { }
    300      48    function b() { }
    301 
    302 RESUMED
    303 
     299     47    function testChainedExpressions() {
     300     48        debugger;
     301
     302RESUMED
     303
     304-- Running test case: Debugger.stepOver.chainedExpressions
     305PAUSED (debugger-statement)
     306PAUSE AT testChainedExpressions:49:5
     307     45    }
     308     46   
     309     47    function testChainedExpressions() {
     310 ->  48        |debugger;
     311     49        a() && b() && c();
     312     50    }
     313     51   
     314
     315PAUSE AT testChainedExpressions:50:5
     316     46   
     317     47    function testChainedExpressions() {
     318     48        debugger;
     319 ->  49        |a() && b() && c();
     320     50    }
     321     51   
     322     52    // ---------
     323
     324PAUSE AT testChainedExpressions:51:2
     325     47    function testChainedExpressions() {
     326     48        debugger;
     327     49        a() && b() && c();
     328 ->  50    }|
     329     51   
     330     52    // ---------
     331     53   
     332
     333RESUMED
     334
  • trunk/LayoutTests/inspector/debugger/stepping/stepOver.html

    r259810 r260113  
    55<script src="../resources/log-pause-location.js"></script>
    66<script>
    7 function testAlert(str) {
    8     alert(str);
    9 }
     7function a() { return "a"; }
     8function b() { return "b"; }
     9function c() { return "c"; }
    1010
    1111function testStatements() {
     
    2929}
    3030
    31 function testLocalFunction() {
     31function testInnerFunction() {
    3232    (function() {
    3333        debugger;
     
    4646}
    4747
    48 function a() { }
    49 function b() { }
    50 function c() { }
     48function testChainedExpressions() {
     49    debugger;
     50    a() && b() && c();
     51}
    5152
    5253// ---------
     
    101102        name: "Debugger.stepOver.innerFunction",
    102103        description: "step-over should step out of a function to its caller.",
    103         expression: "setTimeout(testLocalFunction)",
     104        expression: "setTimeout(testInnerFunction)",
    104105    });
    105106
     
    108109        description: "step-over should step over comma expressions, treating them as statements.",
    109110        expression: "setTimeout(testCommas)",
     111    });
     112
     113    addTestCase({
     114        name: "Debugger.stepOver.chainedExpressions",
     115        description: "step-over should step over chained expressions as a single statement.",
     116        expression: "setTimeout(testChainedExpressions)",
    110117    });
    111118
  • trunk/Source/JavaScriptCore/ChangeLog

    r260057 r260113  
     12020-04-14  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Debugger: add a Step next that steps by expression
     4        https://bugs.webkit.org/show_bug.cgi?id=210324
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Step next is a hybrid of Step over and Step into which continues execution to the next pause
     9        opportunity within the current (or ancestor) call frame. It is especially useful when trying
     10        to debug minified code, such as trying to continue to `c()` in `a() && b() && c();`, where
     11        Step over would continue to the next statement (i.e. after the `;`) and Step in would
     12        continue to the first line inside `a()` (and would require a Step out to get back).
     13
     14        * inspector/protocol/Debugger.json:
     15        * inspector/agents/InspectorDebuggerAgent.h:
     16        * inspector/agents/InspectorDebuggerAgent.cpp:
     17        (Inspector::InspectorDebuggerAgent::stepNext): Added.
     18
     19        * debugger/Debugger.h:
     20        * debugger/Debugger.cpp:
     21        (JSC::Debugger::stepNextExpression): Added.
     22        (JSC::Debugger::atExpression):
     23        (JSC::Debugger::clearNextPauseState):
     24
    1252020-04-13  Alexey Shvayka  <shvaikalesh@gmail.com>
    226
  • trunk/Source/JavaScriptCore/debugger/Debugger.cpp

    r255887 r260113  
    610610}
    611611
     612void Debugger::stepNextExpression()
     613{
     614    if (!m_isPaused)
     615        return;
     616
     617    m_pauseOnCallFrame = m_currentCallFrame;
     618    m_pauseOnStepNext = true;
     619    setSteppingMode(SteppingModeEnabled);
     620    notifyDoneProcessingDebuggerEvents();
     621}
     622
    612623void Debugger::stepIntoStatement()
    613624{
     
    804815    }
    805816
    806     // Only pause at the next expression with step-in and step-out, not step-over.
    807     bool shouldAttemptPause = m_pauseAtNextOpportunity || m_pauseOnStepOut;
     817    // Only pause at the next expression with step-in, step-next, and step-out.
     818    bool shouldAttemptPause = m_pauseAtNextOpportunity || m_pauseOnStepNext || m_pauseOnStepOut;
    808819
    809820    PauseReasonDeclaration reason(*this, PausedAtExpression);
     
    911922    m_pauseOnCallFrame = nullptr;
    912923    m_pauseAtNextOpportunity = false;
     924    m_pauseOnStepNext = false;
    913925    m_pauseOnStepOut = false;
    914926    m_afterBlackboxedScript = false;
  • trunk/Source/JavaScriptCore/debugger/Debugger.h

    r255887 r260113  
    109109    void breakProgram();
    110110    void continueProgram();
     111    void stepNextExpression();
    111112    void stepIntoStatement();
    112113    void stepOverStatement();
     
    231232    bool m_pauseOnDebuggerStatements : 1;
    232233    bool m_pauseAtNextOpportunity : 1;
     234    bool m_pauseOnStepNext : 1;
    233235    bool m_pauseOnStepOut : 1;
    234236    bool m_pastFirstExpressionInStatement : 1;
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp

    r255887 r260113  
    768768}
    769769
     770void InspectorDebuggerAgent::stepNext(ErrorString& errorString)
     771{
     772    if (!assertPaused(errorString))
     773        return;
     774
     775    willStepAndMayBecomeIdle();
     776    m_scriptDebugServer.stepNextExpression();
     777}
     778
    770779void InspectorDebuggerAgent::stepOver(ErrorString& errorString)
    771780{
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h

    r255887 r260113  
    7373    void continueUntilNextRunLoop(ErrorString&) final;
    7474    void continueToLocation(ErrorString&, const JSON::Object& location) final;
     75    void stepNext(ErrorString&) final;
    7576    void stepOver(ErrorString&) final;
    7677    void stepInto(ErrorString&) final;
  • trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json

    r255887 r260113  
    195195                { "name": "location", "$ref": "Location", "description": "Location to continue to." }
    196196            ]
     197        },
     198        {
     199            "name": "stepNext",
     200            "description": "Steps over the expression. This will trigger either a Debugger.paused or Debugger.resumed event."
    197201        },
    198202        {
  • trunk/Source/WebInspectorUI/ChangeLog

    r260108 r260113  
     12020-04-14  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Debugger: add a Step next that steps by expression
     4        https://bugs.webkit.org/show_bug.cgi?id=210324
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Step next is a hybrid of Step over and Step into which continues execution to the next pause
     9        opportunity within the current (or ancestor) call frame. It is especially useful when trying
     10        to debug minified code, such as trying to continue to `c()` in `a() && b() && c();`, where
     11        Step over would continue to the next statement (i.e. after the `;`) and Step in would
     12        continue to the first line inside `a()` (and would require a Step out to get back).
     13
     14        * UserInterface/Controllers/DebuggerManager.js:
     15        (WI.DebuggerManager.prototype.stepNext): Added.
     16
     17        * UserInterface/Base/Main.js:
     18        (WI.contentLoaded):
     19        (WI.debuggerStepNext): Added.
     20        * UserInterface/Views/SourcesNavigationSidebarPanel.js:
     21        (WI.SourcesNavigationSidebarPanel):
     22        (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
     23        (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
     24
     25        * Localizations/en.lproj/localizedStrings.js:
     26        * UserInterface/Images/StepNext.svg: Added.
     27
    1282020-04-14  Nikita Vasilyev  <nvasilyev@apple.com>
    229
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r259929 r260113  
    11801180localizedStrings["Status"] = "Status";
    11811181localizedStrings["Step"] = "Step";
     1182localizedStrings["Step (%s or %s)"] = "Step (%s or %s)";
    11821183localizedStrings["Step into (%s or %s)"] = "Step into (%s or %s)";
    11831184localizedStrings["Step out (%s or %s)"] = "Step out (%s or %s)";
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r259748 r260113  
    363363    WI.stepOutAlternateKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.Shift | WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Semicolon, WI.debuggerStepOut);
    364364
     365    // COMPATIBILITY (iOS 13.4): Debugger.stepNext did not exist yet.
     366    if (InspectorBackend.hasCommand("Debugger.stepNext")) {
     367        WI.stepNextKeyboardShortcut = new WI.KeyboardShortcut(null, WI.KeyboardShortcut.Key.F9, WI.debuggerStepNext);
     368        WI.stepNextAlternateKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.Shift | WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.SingleQuote, WI.debuggerStepNext);
     369    }
     370
    365371    WI.settingsKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Comma, WI._handleSettingsKeyboardShortcut);
    366372
     
    15241530    else
    15251531        WI.debuggerManager.pause();
     1532};
     1533
     1534WI.debuggerStepNext = function(event)
     1535{
     1536    WI.debuggerManager.stepNext();
    15261537};
    15271538
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js

    r255887 r260113  
    569569    }
    570570
     571    stepNext()
     572    {
     573        if (!this.paused)
     574            return Promise.reject(new Error("Cannot step next because debugger is not paused."));
     575
     576        let listener = new WI.EventListener(this, true);
     577
     578        let managerResult = new Promise(function(resolve, reject) {
     579            listener.connect(WI.debuggerManager, WI.DebuggerManager.Event.ActiveCallFrameDidChange, resolve);
     580        });
     581
     582        let protocolResult = this._activeCallFrame.target.DebuggerAgent.stepNext()
     583            .catch(function(error) {
     584                listener.disconnect();
     585                console.error("DebuggerManager.stepNext failed: ", error);
     586                throw error;
     587            });
     588
     589        return Promise.all([managerResult, protocolResult]);
     590    }
     591
    571592    stepOver()
    572593    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js

    r259738 r260113  
    107107        this._debuggerStepOutButtonItem.enabled = false;
    108108
     109        // COMPATIBILITY (iOS 13.4): Debugger.stepNext did not exist yet.
     110        if (InspectorBackend.hasCommand("Debugger.stepNext")) {
     111            this._debuggerStepNextButtonItem = createButtonNavigationitem({
     112                identifier: "debugger-step-next",
     113                toolTipOrLabel: WI.UIString("Step (%s or %s)").format(WI.stepNextKeyboardShortcut.displayName, WI.stepNextAlternateKeyboardShortcut.displayName),
     114                image: "Images/StepNext.svg",
     115            });
     116            this._debuggerStepNextButtonItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, WI.debuggerStepNext, this);
     117            this._debuggerStepNextButtonItem.enabled = false;
     118        }
     119
    109120        this._timelineRecordingWarningElement = null;
    110121        this._auditTestWarningElement = null;
     
    23462357        this._debuggerStepIntoButtonItem.enabled = true;
    23472358        this._debuggerStepOutButtonItem.enabled = true;
     2359        if (this._debuggerStepNextButtonItem)
     2360            this._debuggerStepNextButtonItem.enabled = true;
    23482361
    23492362        this.element.classList.add("paused");
     
    23612374        this._debuggerStepIntoButtonItem.enabled = false;
    23622375        this._debuggerStepOutButtonItem.enabled = false;
     2376        if (this._debuggerStepNextButtonItem)
     2377            this._debuggerStepNextButtonItem.enabled = false;
    23632378
    23642379        this.element.classList.remove("paused");
Note: See TracChangeset for help on using the changeset viewer.