Index: tests/standalone/debugger/debug_lib.dart |
=================================================================== |
--- tests/standalone/debugger/debug_lib.dart (revision 20932) |
+++ tests/standalone/debugger/debug_lib.dart (working copy) |
@@ -11,9 +11,6 @@ |
import "dart:utf"; |
import "dart:json" as JSON; |
-// Whether or not to print debug target process on the console. |
-var showDebuggeeOutput = true; |
- |
// Whether or not to print the debugger wire messages on the console. |
var verboseWire = false; |
@@ -293,13 +290,18 @@ |
int isolateId = 0; |
bool isPaused = false; |
- Debugger(this.targetProcess, this.portNumber) { |
+ Debugger(this.targetProcess, this.portNumber, this.script) { |
stdin.listen((_) {}); |
var stdoutStringStream = targetProcess.stdout |
.transform(new StringDecoder()) |
.transform(new LineTransformer()); |
+ var started = false; |
stdoutStringStream.listen((line) { |
- if (showDebuggeeOutput) { |
+ if (!started) { |
+ // Debuggee initialized message received. |
+ started = true; |
+ openConnection(); |
+ } else { |
print("TARG: $line"); |
} |
kustermann
2013/04/05 08:20:08
I'd actually test if 'line == "Debugger initialize
Tom Ball
2013/04/05 21:28:52
Done.
|
}); |
@@ -308,9 +310,7 @@ |
.transform(new StringDecoder()) |
.transform(new LineTransformer()); |
stderrStringStream.listen((line) { |
- if (showDebuggeeOutput) { |
- print("TARG: $line"); |
- } |
+ print("TARG: $line"); |
}); |
} |
@@ -470,8 +470,6 @@ |
if (options.arguments.contains("--debuggee")) { |
return false; |
} |
- // The default is to show debugging output. |
- showDebuggeeOutput = !options.arguments.contains("--non-verbose"); |
verboseWire = options.arguments.contains("--wire"); |
// Pick a port in the upper half of the port number range. |
@@ -482,7 +480,9 @@ |
ServerSocket.bind('127.0.0.1', debugPort).then((ServerSocket s) { |
s.close(); |
var targetOpts = [ "--debug:$debugPort" ]; |
- if (showDebuggeeOutput) targetOpts.add("--verbose_debug"); |
+ // --verbose_debug is necessary so the test knows when the debuggee |
+ // is initialized. |
+ targetOpts.add("--verbose_debug"); |
targetOpts.add(options.script); |
targetOpts.add("--debuggee"); |
@@ -493,8 +493,8 @@ |
Expect.equals(0, exitCode); |
print("Debug target process exited with exit code $exitCode"); |
}); |
- var debugger = new Debugger(process, debugPort); |
- debugger.runScript(script); |
+ var debugger = |
+ new Debugger(process, debugPort, new DebugScript(script)); |
}); |
}, |
onError: (e) { |