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

Unified Diff: dart/tools/ddbg.dart

Issue 11421121: Enable debugging from a single console. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comment from Mads Created 8 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/ddbg.dart
diff --git a/dart/tools/ddbg.dart b/dart/tools/ddbg.dart
index eaf0258a85f979918ea8fe8cd6595f4997207707..8af5714559008d11326344d91e0fbcd3bf90da01 100644
--- a/dart/tools/ddbg.dart
+++ b/dart/tools/ddbg.dart
@@ -526,7 +526,7 @@ int jsonObjectLength(String string) {
}
-void main() {
+void debuggerMain() {
outstandingCommands = new Map<int, Completer>();
vmSock = new Socket("127.0.0.1", 5858);
vmStream = new SocketOutputStream(vmSock);
@@ -548,3 +548,26 @@ void main() {
quitShell();
};
}
+
+void main() {
+ Options options = new Options();
+ List<String> arguments = options.arguments;
+ if (arguments.length > 0) {
+ arguments = <String>['--debug', '--verbose_debug']..addAll(arguments);
+ Process.start(options.executable, arguments).then((Process process) {
+ process.onExit = (int exitCode) {
+ print('${Strings.join(arguments, " ")} exited with $exitCode');
+ };
+ process.stdin.close();
+ // Redirecting both stdout and stderr of the child process to
+ // stdout. This should help users keep track of which errors
+ // are coming from the debugger, and which errors are coming
+ // from the process being debugged.
+ process.stderr.pipe(stdout);
+ process.stdout.pipe(stdout);
+ debuggerMain();
+ });
+ } else {
+ debuggerMain();
+ }
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698