diff options
author | Greg Clayton <gclayton@apple.com> | 2013-12-04 19:40:33 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-12-04 19:40:33 +0000 |
commit | dbf0457a7b4cab661df1f501c5df424596aeb6ef (patch) | |
tree | 33fee4f8a17e9d0b81c4c1cbbb076f80bc24bda8 /lldb/source/Plugins/Process/gdb-remote | |
parent | c8b38d3389d8c52aa32d30a97dabe60f9aeda9a5 (diff) | |
download | llvm-dbf0457a7b4cab661df1f501c5df424596aeb6ef.zip llvm-dbf0457a7b4cab661df1f501c5df424596aeb6ef.tar.gz llvm-dbf0457a7b4cab661df1f501c5df424596aeb6ef.tar.bz2 |
Allow the hostname to be specified when asking a platform to launch another debugserver in case you want to change it.
The GDB server remote platform how has the debugserver that are launched on iOS devices to use localhost due to the use of a USB mux.
llvm-svn: 196405
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 21 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h | 2 |
2 files changed, 14 insertions, 9 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 2690992..faeb4e2 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -2301,22 +2301,27 @@ GDBRemoteCommunicationClient::SendSpeedTestPacket (uint32_t send_size, uint32_t } uint16_t -GDBRemoteCommunicationClient::LaunchGDBserverAndGetPort (lldb::pid_t &pid) +GDBRemoteCommunicationClient::LaunchGDBserverAndGetPort (lldb::pid_t &pid, const char *remote_accept_hostname) { pid = LLDB_INVALID_PROCESS_ID; StringExtractorGDBRemote response; StreamString stream; stream.PutCString("qLaunchGDBServer;"); std::string hostname; - if (Host::GetHostname (hostname)) - { - // Make the GDB server we launch only accept connections from this host - stream.Printf("host:%s;", hostname.c_str()); - } + if (remote_accept_hostname && remote_accept_hostname[0]) + hostname = remote_accept_hostname; else { - // Make the GDB server we launch accept connections from any host since we can't figure out the hostname - stream.Printf("host:*;"); + if (Host::GetHostname (hostname)) + { + // Make the GDB server we launch only accept connections from this host + stream.Printf("host:%s;", hostname.c_str()); + } + else + { + // Make the GDB server we launch accept connections from any host since we can't figure out the hostname + stream.Printf("host:*;"); + } } const char *packet = stream.GetData(); int packet_len = stream.GetSize(); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h index 564afbb..c5109f7 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h @@ -94,7 +94,7 @@ public: GetLaunchSuccess (std::string &error_str); uint16_t - LaunchGDBserverAndGetPort (lldb::pid_t &pid); + LaunchGDBserverAndGetPort (lldb::pid_t &pid, const char *remote_accept_hostname); bool KillSpawnedProcess (lldb::pid_t pid); |