Files
sdk/tests/standalone/debugger/basic_debugger_test.dart
T
hausner@google.com 2b7746ae05 Allow breakpoints on one-liner functions
Fixes issue 10234. This is also the first step for setting
reliable breakpoints on a == b expressions.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//15000005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22799 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-16 15:44:05 +00:00

49 lines
1.2 KiB
Dart

// Copyright (c) 2012, 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);
}
bam(a) => bar(a);
foo(i) {
bar("baz");
print(i);
}
main() {
if (RunScript(testScript)) return;
print("Hello from debuggee");
foo(42);
bam("bam");
print("Hello again");
}
// Expected debugger events and commands.
var testScript = [
MatchFrame(0, "main"), // Top frame in trace is function "main".
Step(),
MatchFrame(0, "main"), // Should still be in "main".
SetBreakpoint(15), // Set breakpoint a line 15, in function bar.
Resume(),
MatchFrames(["bar", "foo", "main"]),
MatchFrame(1, "foo"),
SetBreakpoint(18), // Set breakpoint a line 18, in function bam.
Resume(),
MatchFrames(["bam", "main"]),
Resume(),
MatchFrames(["bar", "bam", "main"]),
Resume(),
];