summaryrefslogtreecommitdiff
path: root/tools/lldb-platform/lldb-platform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lldb-platform/lldb-platform.cpp')
-rw-r--r--tools/lldb-platform/lldb-platform.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/tools/lldb-platform/lldb-platform.cpp b/tools/lldb-platform/lldb-platform.cpp
index bc9d629747713..e18ebabc784d9 100644
--- a/tools/lldb-platform/lldb-platform.cpp
+++ b/tools/lldb-platform/lldb-platform.cpp
@@ -11,7 +11,7 @@
// C Includes
#include <errno.h>
-#include <getopt.h>
+#include "lldb/Host/HostGetOpt.h"
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
@@ -262,24 +262,18 @@ main (int argc, char *argv[])
std::unique_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor());
if (conn_ap.get())
{
- for (int j = 0; j < listen_host_port.size(); j++)
+ std::string connect_url ("listen://");
+ connect_url.append(listen_host_port.c_str());
+
+ printf ("Listening for a connection from %s...\n", listen_host_port.c_str());
+ if (conn_ap->Connect(connect_url.c_str(), &error) == eConnectionStatusSuccess)
{
- char c = listen_host_port[j];
- if (c > '9' || c < '0')
- printf("WARNING: passing anything but a number as argument to --listen will most probably make connecting impossible.\n");
+ printf ("Connection established.\n");
+ gdb_server.SetConnection (conn_ap.release());
}
- std::auto_ptr<ConnectionFileDescriptor> conn_ap(new ConnectionFileDescriptor());
- if (conn_ap.get())
+ else
{
- std::string connect_url ("listen://");
- connect_url.append(listen_host_port.c_str());
-
- printf ("Listening for a connection on %s...\n", listen_host_port.c_str());
- if (conn_ap->Connect(connect_url.c_str(), &error) == eConnectionStatusSuccess)
- {
- printf ("Connection established.\n");
- gdb_server.SetConnection (conn_ap.release());
- }
+ printf ("error: %s\n", error.AsCString());
}
}