Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 // This test forks a second vm process that runs this dart script as | |
| 6 // a debug target. | |
| 7 // Run this test with option --wire to see the json messages sent | |
| 8 // between the processes. | |
| 9 // Run this test with option --verbose to see the stdout and stderr output | |
| 10 // of the debug target process. | |
| 11 | |
| 12 import "debug_lib.dart"; | |
| 13 | |
| 14 bar(x) { | |
| 15 print(x); | |
| 16 } | |
| 17 | |
| 18 main() { | |
| 19 if (RunScript(testScript)) return; | |
| 20 print("Hello from debuggee"); | |
| 21 var f = bar; | |
| 22 f("closure call"); | |
| 23 bar(12); | |
| 24 } | |
| 25 | |
| 26 | |
| 27 // Expected debugger events and commands. | |
| 28 var testScript = [ | |
| 29 MatchFrame(0, "main"), // Top frame in trace is function "main". | |
| 30 SetBreakpoint(22), // Set breakpoint a line 22, at the closure call. | |
| 31 Resume(), | |
| 32 MatchFrame(0, "main"), // Should be at closure call. | |
| 33 StepInto(), | |
| 34 MatchFrames(["bar", "main"]), // Should be in closure function now. | |
| 35 StepOut(), | |
| 36 MatchFrame(0, "main"), // Back in main, before static call to bar(). | |
| 37 SetBreakpoint(15), // Breakpoint in bar(); | |
|
siva
2013/05/10 22:02:58
Maybe SetBreakpoint("bar") would be more readable
hausner
2013/05/16 16:32:39
As discussed offline, this is certainly brittle co
| |
| 38 Resume(), | |
| 39 MatchFrames(["bar", "main"]), | |
| 40 Resume(), | |
| 41 ]; | |
| OLD | NEW |