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

Unified Diff: runtime/bin/dbg_connection.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/dbg_connection.cc
===================================================================
--- runtime/bin/dbg_connection.cc (revision 23045)
+++ runtime/bin/dbg_connection.cc (working copy)
@@ -278,12 +278,13 @@
}
-void DebuggerConnectionHandler::StartHandler(const char* address,
- int port_number) {
+int DebuggerConnectionHandler::StartHandler(const char* address,
+ int port_number) {
ASSERT(handler_lock_ != NULL);
MonitorLocker ml(handler_lock_);
if (listener_fd_ != -1) {
- return; // The debugger connection handler was already started.
+ // The debugger connection handler was already started.
+ return Socket::GetPort(listener_fd_);
}
// First setup breakpoint, exception and delayed breakpoint handlers.
@@ -298,12 +299,13 @@
// listen, accept connections from debuggers, read and handle/dispatch
// debugger commands received on these connections.
ASSERT(listener_fd_ == -1);
-
OSError *os_error;
SocketAddresses* addresses = Socket::LookupAddress(address, -1, &os_error);
listener_fd_ = ServerSocket::CreateBindListen(
addresses->GetAt(0)->addr(), port_number, 1);
+ port_number = Socket::GetPort(listener_fd_);
DebuggerConnectionImpl::StartHandler(port_number);
+ return port_number;
}

Powered by Google App Engine
This is Rietveld 408576698