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

Unified Diff: runtime/bin/main.cc

Issue 15507004: Let debug target pick the debugger port (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
Index: runtime/bin/main.cc
===================================================================
--- runtime/bin/main.cc (revision 23045)
+++ runtime/bin/main.cc (working copy)
@@ -47,7 +47,7 @@
static const int DEFAULT_DEBUG_PORT = 5858;
static const char* DEFAULT_DEBUG_IP = "127.0.0.1";
static const char* debug_ip = DEFAULT_DEBUG_IP;
-static int debug_port = 0;
+static int debug_port = -1;
// Global state that defines the VmStats web server port and root directory.
static int vmstats_port = -1;
@@ -148,7 +148,7 @@
// TODO(hausner): Add support for specifying an IP address on which
// the debugger should listen.
ASSERT(port != NULL);
- debug_port = 0;
+ debug_port = -1;
if (*port == '\0') {
debug_port = DEFAULT_DEBUG_PORT;
} else {
@@ -156,7 +156,7 @@
debug_port = atoi(port + 1);
}
}
- if (debug_port == 0) {
+ if (debug_port < 0) {
Log::PrintErr("unrecognized --debug option syntax. "
"Use --debug[:<port number>]\n");
return false;
@@ -725,10 +725,11 @@
// Start the debugger wire protocol handler if necessary.
if (start_debugger) {
- ASSERT(debug_port != 0);
- DebuggerConnectionHandler::StartHandler(debug_ip, debug_port);
- if (verbose_debug_seen) {
- Log::Print("Debugger initialized\n");
+ ASSERT(debug_port >= 0);
+ bool print_msg = verbose_debug_seen || (debug_port == 0);
+ debug_port = DebuggerConnectionHandler::StartHandler(debug_ip, debug_port);
+ if (print_msg) {
+ Log::Print("Debugger listening on port %d\n", debug_port);
}
}
VmStats::Start(vmstats_port, vmstats_root, verbose_debug_seen);

Powered by Google App Engine
This is Rietveld 408576698