Changeset 260113 in webkit
- Timestamp:
- Apr 14, 2020 7:35:04 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 18 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r260097 r260113 1 2020-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 1 19 2020-04-14 Diego Pino Garcia <dpino@igalia.com> 2 20 -
trunk/LayoutTests/inspector/debugger/stepping/stepInto-expected.txt
r206652 r260113 1 ALERT: log 12 1 Checking pause locations when stepping with "stepInto". 3 2 … … 6 5 -- Running test case: Debugger.stepInto.statements 7 6 PAUSED (debugger-statement) 8 PAUSE AT entry1:12:59 8 }10 9 11 10 function entry1() {7 PAUSE AT testStatements:12:5 8 8 function c() { return "c"; } 9 9 10 10 function testStatements() { 12 11 -> 11 |debugger; 13 12 12 let x = 1; … … 15 14 14 } 16 15 17 PAUSE AT entry1:13:518 9 19 10 function entry1() {16 PAUSE AT testStatements:13:5 17 9 18 10 function testStatements() { 20 19 11 debugger; 21 20 -> 12 |let x = 1; … … 24 23 15 25 24 26 PAUSE AT entry1:14:527 10 function entry1() {25 PAUSE AT testStatements:14:5 26 10 function testStatements() { 28 27 11 debugger; 29 28 12 let x = 1; … … 31 30 14 } 32 31 15 33 16 function entry2() {34 35 PAUSE AT entry1:15:232 16 function testFunctions() { 33 34 PAUSE AT testStatements:15:2 36 35 11 debugger; 37 36 12 let x = 1; … … 39 38 -> 14 }| 40 39 15 41 16 function entry2() {40 16 function testFunctions() { 42 41 17 debugger; 43 42 … … 46 45 -- Running test case: Debugger.stepInto.function 47 46 PAUSED (debugger-statement) 48 PAUSE AT entry2:18:547 PAUSE AT testFunctions:18:5 49 48 14 } 50 49 15 51 16 function entry2() {50 16 function testFunctions() { 52 51 -> 17 |debugger; 53 52 18 let before = 1; 54 19 testAlert("log 1");53 19 a(); 55 54 20 let after = 2; 56 55 57 PAUSE AT entry2:19:556 PAUSE AT testFunctions:19:5 58 57 15 59 16 function entry2() {58 16 function testFunctions() { 60 59 17 debugger; 61 60 -> 18 |let before = 1; 62 19 testAlert("log 1");61 19 a(); 63 62 20 let after = 2; 64 63 21 } 65 64 66 PAUSE AT entry2:20:567 16 function entry2() {65 PAUSE AT testFunctions:20:5 66 16 function testFunctions() { 68 67 17 debugger; 69 68 18 let before = 1; 70 -> 19 | testAlert("log 1");69 -> 19 |a(); 71 70 20 let after = 2; 72 71 21 } 73 72 22 74 73 75 PAUSE AT testAlert:8:576 4 <script src="../resources/log-pause-location.js"></script>77 5 <script>78 6 function testAlert(str) {79 -> 7 |alert(str);80 8}81 982 10 function entry1() {83 84 PAUSE AT testAlert:9:285 5 <script>86 6 function testAlert(str) {87 7 alert(str);88 -> 8}|89 990 10 function entry1() {91 11 debugger;92 93 PAUSE AT entry2:21:574 PAUSE 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 83 PAUSE 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 92 PAUSE AT testFunctions:21:5 94 93 17 debugger; 95 94 18 let before = 1; 96 19 testAlert("log 1");95 19 a(); 97 96 -> 20 |let after = 2; 98 97 21 } 99 98 22 100 23 function entry3() {101 102 PAUSE AT entry2:22:299 23 function testEval() { 100 101 PAUSE AT testFunctions:22:2 103 102 18 let before = 1; 104 19 testAlert("log 1");103 19 a(); 105 104 20 let after = 2; 106 105 -> 21 }| 107 106 22 108 23 function entry3() {107 23 function testEval() { 109 108 24 debugger; 110 109 … … 113 112 -- Running test case: Debugger.stepInto.eval 114 113 PAUSED (debugger-statement) 115 PAUSE AT entry3:25:5114 PAUSE AT testEval:25:5 116 115 21 } 117 116 22 118 23 function entry3() {117 23 function testEval() { 119 118 -> 24 |debugger; 120 119 25 let before = 1; … … 122 121 27 let after = 2; 123 122 124 PAUSE AT entry3:26:5123 PAUSE AT testEval:26:5 125 124 22 126 23 function entry3() {125 23 function testEval() { 127 126 24 debugger; 128 127 -> 25 |let before = 1; … … 131 130 28 } 132 131 133 PAUSE AT entry3:27:5134 23 function entry3() {132 PAUSE AT testEval:27:5 133 23 function testEval() { 135 134 24 debugger; 136 135 25 let before = 1; … … 146 145 --- Source Unavailable --- 147 146 148 PAUSE AT entry3:28:5147 PAUSE AT testEval:28:5 149 148 24 debugger; 150 149 25 let before = 1; … … 153 152 28 } 154 153 29 155 30 function entry4() {156 157 PAUSE AT entry3:29:2154 30 function testInnerFunction() { 155 156 PAUSE AT testEval:29:2 158 157 25 let before = 1; 159 158 26 eval("1 + 1"); … … 161 160 -> 28 }| 162 161 29 163 30 function entry4() {162 30 function testInnerFunction() { 164 163 31 (function() { 165 164 … … 170 169 PAUSE AT <anonymous>:33:9 171 170 29 172 30 function entry4() {171 30 function testInnerFunction() { 173 172 31 (function() { 174 173 -> 32 |debugger; … … 178 177 179 178 PAUSE AT <anonymous>:34:9 180 30 function entry4() {179 30 function testInnerFunction() { 181 180 31 (function() { 182 181 32 debugger; … … 195 194 37 196 195 197 PAUSE AT entry4:36:5196 PAUSE AT testInnerFunction:36:5 198 197 32 debugger; 199 198 33 let inner = 1; … … 202 201 36 } 203 202 37 204 38 // ---------205 206 PAUSE AT entry4:37:2203 38 function testCommas() { 204 205 PAUSE AT testInnerFunction:37:2 207 206 33 let inner = 1; 208 207 34 })(); … … 210 209 -> 36 }| 211 210 37 212 38 // ---------213 39 211 38 function testCommas() { 212 39 debugger; 214 213 215 214 RESUMED 216 215 216 -- Running test case: Debugger.stepInto.commas 217 PAUSED (debugger-statement) 218 PAUSE 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 227 PAUSE 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 236 PAUSE 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 245 PAUSE 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 254 PAUSE 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 263 PAUSE 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 272 PAUSE 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 281 PAUSE 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 290 PAUSE 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 299 PAUSE 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 308 PAUSE 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 317 PAUSE 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 326 PAUSE 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 335 PAUSE 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 344 PAUSE 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 353 PAUSE 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 362 PAUSE 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 371 PAUSE 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 380 PAUSE 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 389 PAUSE 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 398 PAUSE 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 407 PAUSE 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 416 PAUSE 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 425 PAUSE 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 434 RESUMED 435 436 -- Running test case: Debugger.stepInto.chainedExpressions 437 PAUSED (debugger-statement) 438 PAUSE 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 447 PAUSE 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 456 PAUSE 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 465 PAUSE 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 474 PAUSE 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 483 PAUSE 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 492 PAUSE 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 501 PAUSE 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 510 PAUSE 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 519 PAUSE 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 528 PAUSE 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 537 RESUMED 538 -
trunk/LayoutTests/inspector/debugger/stepping/stepInto.html
r220119 r260113 5 5 <script src="../resources/log-pause-location.js"></script> 6 6 <script> 7 function testAlert(str) {8 alert(str); 9 }7 function a() { return "a"; } 8 function b() { return "b"; } 9 function c() { return "c"; } 10 10 11 function entry1() {11 function testStatements() { 12 12 debugger; 13 13 let x = 1; … … 15 15 } 16 16 17 function entry2() {17 function testFunctions() { 18 18 debugger; 19 19 let before = 1; 20 testAlert("log 1");20 a(); 21 21 let after = 2; 22 22 } 23 23 24 function entry3() {24 function testEval() { 25 25 debugger; 26 26 let before = 1; … … 29 29 } 30 30 31 function entry4() {31 function testInnerFunction() { 32 32 (function() { 33 33 debugger; … … 35 35 })(); 36 36 let outer = 2; 37 } 38 39 function testCommas() { 40 debugger; 41 let x = 1, 42 y = 2, 43 z = 3; 44 a(), b(), c(); 45 true && (a(), b(), c()); 46 } 47 48 function testChainedExpressions() { 49 debugger; 50 a() && b() && c(); 37 51 } 38 52 … … 70 84 name: "Debugger.stepInto.statements", 71 85 description: "step-into should step over statements.", 72 expression: "setTimeout( entry1)",86 expression: "setTimeout(testStatements)", 73 87 }); 74 88 … … 76 90 name: "Debugger.stepInto.function", 77 91 description: "step-into should step into function calls.", 78 expression: "setTimeout( entry2)",92 expression: "setTimeout(testFunctions)", 79 93 }); 80 94 … … 82 96 name: "Debugger.stepInto.eval", 83 97 description: "step-into should step into an eval program.", 84 expression: "setTimeout( entry3)",98 expression: "setTimeout(testEval)", 85 99 }); 86 100 … … 88 102 name: "Debugger.stepInto.innerFunction", 89 103 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)", 91 117 }); 92 118 -
trunk/LayoutTests/inspector/debugger/stepping/stepNext-expected.txt
r260112 r260113 1 Checking pause locations when stepping with "step Over".2 3 4 == Running test suite: Debugger.step Over5 -- Running test case: Debugger.step Over.statements1 Checking pause locations when stepping with "stepNext". 2 3 4 == Running test suite: Debugger.stepNext 5 -- Running test case: Debugger.stepNext.statements 6 6 PAUSED (debugger-statement) 7 7 PAUSE AT testStatements:12:5 8 8 }8 8 function c() { return "c"; } 9 9 9 10 10 10 function testStatements() { … … 43 43 RESUMED 44 44 45 -- Running test case: Debugger.step Over.function45 -- Running test case: Debugger.stepNext.function 46 46 PAUSED (debugger-statement) 47 47 PAUSE AT testFunctions:18:5 … … 92 92 RESUMED 93 93 94 -- Running test case: Debugger.step Over.eval94 -- Running test case: Debugger.stepNext.eval 95 95 PAUSED (debugger-statement) 96 96 PAUSE AT testEval:25:5 … … 128 128 28 } 129 129 29 130 30 function test LocalFunction() {130 30 function testInnerFunction() { 131 131 132 132 PAUSE AT testEval:29:2 … … 136 136 -> 28 }| 137 137 29 138 30 function test LocalFunction() {138 30 function testInnerFunction() { 139 139 31 (function() { 140 140 141 141 RESUMED 142 142 143 -- Running test case: Debugger.step Over.innerFunction143 -- Running test case: Debugger.stepNext.innerFunction 144 144 PAUSED (debugger-statement) 145 145 PAUSE AT <anonymous>:33:9 146 146 29 147 30 function test LocalFunction() {147 30 function testInnerFunction() { 148 148 31 (function() { 149 149 -> 32 |debugger; … … 153 153 154 154 PAUSE AT <anonymous>:34:9 155 30 function test LocalFunction() {155 30 function testInnerFunction() { 156 156 31 (function() { 157 157 32 debugger; … … 170 170 37 171 171 172 PAUSE AT test LocalFunction:36:5172 PAUSE AT testInnerFunction:36:5 173 173 32 debugger; 174 174 33 let inner = 1; … … 179 179 38 function testCommas() { 180 180 181 PAUSE AT test LocalFunction:37:2181 PAUSE AT testInnerFunction:37:2 182 182 33 let inner = 1; 183 183 34 })(); … … 190 190 RESUMED 191 191 192 -- Running test case: Debugger.step Over.commas192 -- Running test case: Debugger.stepNext.commas 193 193 PAUSED (debugger-statement) 194 194 PAUSE AT testCommas:40:5 … … 262 262 45 } 263 263 46 264 47 function a() { }264 47 function testChainedExpressions() { 265 265 266 266 PAUSE AT testCommas:45:14 … … 271 271 45 } 272 272 46 273 47 function a() { }273 47 function testChainedExpressions() { 274 274 275 275 PAUSE AT testCommas:45:19 … … 280 280 45 } 281 281 46 282 47 function a() { }282 47 function testChainedExpressions() { 283 283 284 284 PAUSE AT testCommas:45:24 … … 289 289 45 } 290 290 46 291 47 function a() { }291 47 function testChainedExpressions() { 292 292 293 293 PAUSE AT testCommas:46:2 … … 297 297 -> 45 }| 298 298 46 299 47 function a() { } 300 48 function b() { } 301 302 RESUMED 303 299 47 function testChainedExpressions() { 300 48 debugger; 301 302 RESUMED 303 304 -- Running test case: Debugger.stepNext.chainedExpressions 305 PAUSED (debugger-statement) 306 PAUSE 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 315 PAUSE 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 324 PAUSE 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 333 PAUSE 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 342 PAUSE 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 351 RESUMED 352 -
trunk/LayoutTests/inspector/debugger/stepping/stepNext.html
r260112 r260113 5 5 <script src="../resources/log-pause-location.js"></script> 6 6 <script> 7 function testAlert(str) {8 alert(str); 9 }7 function a() { return "a"; } 8 function b() { return "b"; } 9 function c() { return "c"; } 10 10 11 11 function testStatements() { … … 29 29 } 30 30 31 function test LocalFunction() {31 function testInnerFunction() { 32 32 (function() { 33 33 debugger; … … 46 46 } 47 47 48 function a() { } 49 function b() { } 50 function c() { } 48 function testChainedExpressions() { 49 debugger; 50 a() && b() && c(); 51 } 51 52 52 53 // --------- … … 54 55 function test() 55 56 { 56 let suite = InspectorTest.createAsyncSuite("Debugger.step Over");57 let suite = InspectorTest.createAsyncSuite("Debugger.stepNext"); 57 58 58 // Always step- overwhen call frames change.59 // Always step-next when call frames change. 59 60 WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.CallFramesDidChange, (event) => { 60 61 if (!WI.debuggerManager.activeCallFrame) 61 62 return; 62 63 logPauseLocation(); 63 WI.debuggerManager.step Over();64 WI.debuggerManager.stepNext(); 64 65 }); 65 66 … … 81 82 82 83 addTestCase({ 83 name: "Debugger.step Over.statements",84 description: "step- overshould step over statements.",84 name: "Debugger.stepNext.statements", 85 description: "step-next should step over statements.", 85 86 expression: "setTimeout(testStatements)", 86 87 }); 87 88 88 89 addTestCase({ 89 name: "Debugger.step Over.function",90 description: "step- overshould step over function calls.",90 name: "Debugger.stepNext.function", 91 description: "step-next should step over function calls.", 91 92 expression: "setTimeout(testFunctions)", 92 93 }); 93 94 94 95 addTestCase({ 95 name: "Debugger.step Over.eval",96 description: "step- overshould step over an eval program.",96 name: "Debugger.stepNext.eval", 97 description: "step-next should step over an eval program.", 97 98 expression: "setTimeout(testEval)", 98 99 }); 99 100 100 101 addTestCase({ 101 name: "Debugger.step Over.innerFunction",102 description: "step- overshould step out of a function to its caller.",103 expression: "setTimeout(test LocalFunction)",102 name: "Debugger.stepNext.innerFunction", 103 description: "step-next should step out of a function to its caller.", 104 expression: "setTimeout(testInnerFunction)", 104 105 }); 105 106 106 107 addTestCase({ 107 name: "Debugger.step Over.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.", 109 110 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)", 110 117 }); 111 118 … … 117 124 </head> 118 125 <body onload="runTest()"> 119 <p>Checking pause locations when stepping with "step Over".</p>126 <p>Checking pause locations when stepping with "stepNext".</p> 120 127 </body> 121 128 </html> -
trunk/LayoutTests/inspector/debugger/stepping/stepOut-expected.txt
r206652 r260113 5 5 -- Running test case: Debugger.stepOut.function 6 6 PAUSED (debugger-statement) 7 PAUSE AT entry1:8:58 4 <script src="../resources/log-pause-location.js"></script>9 5 <script>10 6 function entry1() {11 -> 7|debugger;12 8let x = 1;13 9let y = 2;14 1 0}7 PAUSE 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 } 15 15 16 16 RESUMED … … 25 25 -- Running test case: Debugger.stepOut.innerFunction 26 26 PAUSED (debugger-statement) 27 PAUSE AT beta:2 4:928 2 0beta();29 2 1}30 2 2function beta() {31 -> 2 3|debugger;32 2 4}33 2 5alpha();34 26}27 PAUSE AT beta:28:9 28 24 beta(); 29 25 } 30 26 function beta() { 31 -> 27 |debugger; 32 28 } 33 29 alpha(); 34 30 } 35 35 36 PAUSE AT alpha:2 2:637 18 function entry3() {38 19function alpha() {39 2 0beta();40 -> 2 1}|41 2 2function beta() {42 2 3debugger;43 2 4}36 PAUSE 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 } 44 44 45 PAUSE AT entry3:27:246 2 3debugger;47 2 4}48 2 5alpha();49 -> 26}|50 2751 28 function entry4() {52 29(function() {45 PAUSE AT testInnerFunction:31:2 46 27 debugger; 47 28 } 48 29 alpha(); 49 -> 30 }| 50 31 51 32 function testAnonymousFunction() { 52 33 (function() { 53 53 54 54 RESUMED … … 56 56 -- Running test case: Debugger.stepOut.anonymousFunction 57 57 PAUSED (debugger-statement) 58 PAUSE AT <anonymous>:3 1:959 2760 28 function entry4() {61 29(function() {62 -> 3 0|debugger;63 3 1let inner = 1;64 3 2})();65 3 3let outer = 2;58 PAUSE 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; 66 66 67 PAUSE AT entry4:34:568 3 0debugger;69 3 1let inner = 1;70 3 2})();71 -> 3 3|let outer = 2;72 3 4}73 3 574 36 // ---------67 PAUSE 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() { 75 75 76 76 RESUMED 77 77 78 -- Running test case: Debugger.stepOut.commas 79 PAUSED (debugger-statement) 80 PAUSE 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 89 RESUMED 90 91 -- Running test case: Debugger.stepOut.chainedExpressions 92 PAUSED (debugger-statement) 93 PAUSE 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 102 RESUMED 103 -
trunk/LayoutTests/inspector/debugger/stepping/stepOut.html
r220119 r260113 5 5 <script src="../resources/log-pause-location.js"></script> 6 6 <script> 7 function entry1() { 7 function a() { return "a"; } 8 function b() { return "b"; } 9 function c() { return "c"; } 10 11 function testFunctions() { 8 12 debugger; 9 13 let x = 1; … … 11 15 } 12 16 13 function entry2() {17 function testEval() { 14 18 let before = 1; 15 19 eval("debugger"); … … 17 21 } 18 22 19 function entry3() {23 function testInnerFunction() { 20 24 function alpha() { 21 25 beta(); … … 27 31 } 28 32 29 function entry4() {33 function testAnonymousFunction() { 30 34 (function() { 31 35 debugger; … … 33 37 })(); 34 38 let outer = 2; 39 } 40 41 function testCommas() { 42 debugger; 43 let x = 1, 44 y = 2, 45 z = 3; 46 a(), b(), c(); 47 true && (a(), b(), c()); 48 } 49 50 function testChainedExpressions() { 51 debugger; 52 a() && b() && c(); 35 53 } 36 54 … … 68 86 name: "Debugger.stepOut.function", 69 87 description: "step-out should leave a function.", 70 expression: "setTimeout( entry1)",88 expression: "setTimeout(testFunctions)", 71 89 }); 72 90 … … 74 92 name: "Debugger.stepOut.eval", 75 93 description: "step-out should step leave an eval program.", 76 expression: "setTimeout( entry2)",94 expression: "setTimeout(testEval)", 77 95 }); 78 96 … … 80 98 name: "Debugger.stepOut.innerFunction", 81 99 description: "step-out should leave a function and end up after its callsite.", 82 expression: "setTimeout( entry3)",100 expression: "setTimeout(testInnerFunction)", 83 101 }); 84 102 … … 86 104 name: "Debugger.stepOut.anonymousFunction", 87 105 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)", 89 119 }); 90 120 -
trunk/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt
r259810 r260113 6 6 PAUSED (debugger-statement) 7 7 PAUSE AT testStatements:12:5 8 8 }8 8 function c() { return "c"; } 9 9 9 10 10 10 function testStatements() { … … 128 128 28 } 129 129 29 130 30 function test LocalFunction() {130 30 function testInnerFunction() { 131 131 132 132 PAUSE AT testEval:29:2 … … 136 136 -> 28 }| 137 137 29 138 30 function test LocalFunction() {138 30 function testInnerFunction() { 139 139 31 (function() { 140 140 … … 145 145 PAUSE AT <anonymous>:33:9 146 146 29 147 30 function test LocalFunction() {147 30 function testInnerFunction() { 148 148 31 (function() { 149 149 -> 32 |debugger; … … 153 153 154 154 PAUSE AT <anonymous>:34:9 155 30 function test LocalFunction() {155 30 function testInnerFunction() { 156 156 31 (function() { 157 157 32 debugger; … … 170 170 37 171 171 172 PAUSE AT test LocalFunction:36:5172 PAUSE AT testInnerFunction:36:5 173 173 32 debugger; 174 174 33 let inner = 1; … … 179 179 38 function testCommas() { 180 180 181 PAUSE AT test LocalFunction:37:2181 PAUSE AT testInnerFunction:37:2 182 182 33 let inner = 1; 183 183 34 })(); … … 262 262 45 } 263 263 46 264 47 function a() { }264 47 function testChainedExpressions() { 265 265 266 266 PAUSE AT testCommas:45:14 … … 271 271 45 } 272 272 46 273 47 function a() { }273 47 function testChainedExpressions() { 274 274 275 275 PAUSE AT testCommas:45:19 … … 280 280 45 } 281 281 46 282 47 function a() { }282 47 function testChainedExpressions() { 283 283 284 284 PAUSE AT testCommas:45:24 … … 289 289 45 } 290 290 46 291 47 function a() { }291 47 function testChainedExpressions() { 292 292 293 293 PAUSE AT testCommas:46:2 … … 297 297 -> 45 }| 298 298 46 299 47 function a() { } 300 48 function b() { } 301 302 RESUMED 303 299 47 function testChainedExpressions() { 300 48 debugger; 301 302 RESUMED 303 304 -- Running test case: Debugger.stepOver.chainedExpressions 305 PAUSED (debugger-statement) 306 PAUSE 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 315 PAUSE 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 324 PAUSE 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 333 RESUMED 334 -
trunk/LayoutTests/inspector/debugger/stepping/stepOver.html
r259810 r260113 5 5 <script src="../resources/log-pause-location.js"></script> 6 6 <script> 7 function testAlert(str) {8 alert(str); 9 }7 function a() { return "a"; } 8 function b() { return "b"; } 9 function c() { return "c"; } 10 10 11 11 function testStatements() { … … 29 29 } 30 30 31 function test LocalFunction() {31 function testInnerFunction() { 32 32 (function() { 33 33 debugger; … … 46 46 } 47 47 48 function a() { } 49 function b() { } 50 function c() { } 48 function testChainedExpressions() { 49 debugger; 50 a() && b() && c(); 51 } 51 52 52 53 // --------- … … 101 102 name: "Debugger.stepOver.innerFunction", 102 103 description: "step-over should step out of a function to its caller.", 103 expression: "setTimeout(test LocalFunction)",104 expression: "setTimeout(testInnerFunction)", 104 105 }); 105 106 … … 108 109 description: "step-over should step over comma expressions, treating them as statements.", 109 110 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)", 110 117 }); 111 118 -
trunk/Source/JavaScriptCore/ChangeLog
r260057 r260113 1 2020-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 1 25 2020-04-13 Alexey Shvayka <shvaikalesh@gmail.com> 2 26 -
trunk/Source/JavaScriptCore/debugger/Debugger.cpp
r255887 r260113 610 610 } 611 611 612 void 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 612 623 void Debugger::stepIntoStatement() 613 624 { … … 804 815 } 805 816 806 // Only pause at the next expression with step-in and step-out, not step-over.807 bool shouldAttemptPause = m_pauseAtNextOpportunity || m_pauseOnStep Out;817 // Only pause at the next expression with step-in, step-next, and step-out. 818 bool shouldAttemptPause = m_pauseAtNextOpportunity || m_pauseOnStepNext || m_pauseOnStepOut; 808 819 809 820 PauseReasonDeclaration reason(*this, PausedAtExpression); … … 911 922 m_pauseOnCallFrame = nullptr; 912 923 m_pauseAtNextOpportunity = false; 924 m_pauseOnStepNext = false; 913 925 m_pauseOnStepOut = false; 914 926 m_afterBlackboxedScript = false; -
trunk/Source/JavaScriptCore/debugger/Debugger.h
r255887 r260113 109 109 void breakProgram(); 110 110 void continueProgram(); 111 void stepNextExpression(); 111 112 void stepIntoStatement(); 112 113 void stepOverStatement(); … … 231 232 bool m_pauseOnDebuggerStatements : 1; 232 233 bool m_pauseAtNextOpportunity : 1; 234 bool m_pauseOnStepNext : 1; 233 235 bool m_pauseOnStepOut : 1; 234 236 bool m_pastFirstExpressionInStatement : 1; -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
r255887 r260113 768 768 } 769 769 770 void InspectorDebuggerAgent::stepNext(ErrorString& errorString) 771 { 772 if (!assertPaused(errorString)) 773 return; 774 775 willStepAndMayBecomeIdle(); 776 m_scriptDebugServer.stepNextExpression(); 777 } 778 770 779 void InspectorDebuggerAgent::stepOver(ErrorString& errorString) 771 780 { -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
r255887 r260113 73 73 void continueUntilNextRunLoop(ErrorString&) final; 74 74 void continueToLocation(ErrorString&, const JSON::Object& location) final; 75 void stepNext(ErrorString&) final; 75 76 void stepOver(ErrorString&) final; 76 77 void stepInto(ErrorString&) final; -
trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json
r255887 r260113 195 195 { "name": "location", "$ref": "Location", "description": "Location to continue to." } 196 196 ] 197 }, 198 { 199 "name": "stepNext", 200 "description": "Steps over the expression. This will trigger either a Debugger.paused or Debugger.resumed event." 197 201 }, 198 202 { -
trunk/Source/WebInspectorUI/ChangeLog
r260108 r260113 1 2020-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 1 28 2020-04-14 Nikita Vasilyev <nvasilyev@apple.com> 2 29 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r259929 r260113 1180 1180 localizedStrings["Status"] = "Status"; 1181 1181 localizedStrings["Step"] = "Step"; 1182 localizedStrings["Step (%s or %s)"] = "Step (%s or %s)"; 1182 1183 localizedStrings["Step into (%s or %s)"] = "Step into (%s or %s)"; 1183 1184 localizedStrings["Step out (%s or %s)"] = "Step out (%s or %s)"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r259748 r260113 363 363 WI.stepOutAlternateKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.Shift | WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Semicolon, WI.debuggerStepOut); 364 364 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 365 371 WI.settingsKeyboardShortcut = new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Comma, WI._handleSettingsKeyboardShortcut); 366 372 … … 1524 1530 else 1525 1531 WI.debuggerManager.pause(); 1532 }; 1533 1534 WI.debuggerStepNext = function(event) 1535 { 1536 WI.debuggerManager.stepNext(); 1526 1537 }; 1527 1538 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
r255887 r260113 569 569 } 570 570 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 571 592 stepOver() 572 593 { -
trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js
r259738 r260113 107 107 this._debuggerStepOutButtonItem.enabled = false; 108 108 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 109 120 this._timelineRecordingWarningElement = null; 110 121 this._auditTestWarningElement = null; … … 2346 2357 this._debuggerStepIntoButtonItem.enabled = true; 2347 2358 this._debuggerStepOutButtonItem.enabled = true; 2359 if (this._debuggerStepNextButtonItem) 2360 this._debuggerStepNextButtonItem.enabled = true; 2348 2361 2349 2362 this.element.classList.add("paused"); … … 2361 2374 this._debuggerStepIntoButtonItem.enabled = false; 2362 2375 this._debuggerStepOutButtonItem.enabled = false; 2376 if (this._debuggerStepNextButtonItem) 2377 this._debuggerStepNextButtonItem.enabled = false; 2363 2378 2364 2379 this.element.classList.remove("paused");
Note: See TracChangeset
for help on using the changeset viewer.