Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1165)

Unified Diff: tests/standalone/debugger/closure_bp_test.dart

Issue 149853004: Find all compiled copies of a function when setting breakpoint (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/debugger/closure_bp_test.dart
===================================================================
--- tests/standalone/debugger/closure_bp_test.dart (revision 0)
+++ tests/standalone/debugger/closure_bp_test.dart (working copy)
@@ -0,0 +1,47 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// This test forks a second vm process that runs this dart script as
+// a debug target.
+// Run this test with option --wire to see the json messages sent
+// between the processes.
+// Run this test with option --verbose to see the stdout and stderr output
+// of the debug target process.
+
+import "debug_lib.dart";
+
+bar(x) {
+ print(x);
+}
+
+main(List<String> arguments) {
+ if (RunScript(testScript, arguments)) return;
+ print("Hello from debuggee");
+ [1,2].forEach(bar); // Causes implicit closure of bar to be compiled.
+ print("stop here"); // Stop here and set breakpoint in bar.
+ [3,4].forEach(bar); // Call bar closure and observe breakpoints being hit.
+ print("done");
+}
+
+
+// Expected debugger events and commands.
+var testScript = [
+ MatchFrame(0, "main"), // Top frame in trace is function "main".
+ SetBreakpoint(22), // Set breakpoint a line 22, after bar closure is compiled.
+ Resume(),
+ MatchFrame(0, "main"), // Should be at line 22 in main.
+ MatchLine(22),
+ SetBreakpoint(15), // Set breakpoint in function bar. Bar has not been called
+ // through a regular function call at this point, only
+ // through a closure from forEach().
+ Resume(),
+ MatchFrames(["bar", "forEach", "main"]), // Should be in closure function now.
+ MatchLine(15),
+ MatchLocals({"x": "3"}),
+ Resume(),
+ MatchFrames(["bar", "forEach", "main"]), // Should be in closure function now.
+ MatchLine(15),
+ MatchLocals({"x": "4"}),
+ Resume(),
+];
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698