diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-03-20 06:08:36 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-03-20 06:08:36 +0000 |
commit | a68f7b67f173abecc0ebaefa63dde9a93e78137e (patch) | |
tree | dcb100b47b23e45aa6781caa5410cbda22ead338 /lldb/source/Plugins/Process | |
parent | 2643b9053e2fff0247fb57716f20a00ca5b1abe9 (diff) | |
download | bcm5719-llvm-a68f7b67f173abecc0ebaefa63dde9a93e78137e.tar.gz bcm5719-llvm-a68f7b67f173abecc0ebaefa63dde9a93e78137e.zip |
cleanup unreferenced functions
This is a mechanical cleanup of unused functions. In the case where the
functions are referenced (in comment form), I've simply commented out the
functions. A second pass to clean that up is warranted.
The functions which are otherwise unused have been removed. Some of these were
introduced in the initial commit and not in use prior to that point!
NFC
llvm-svn: 204310
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | 21 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 9 |
2 files changed, 5 insertions, 25 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index fbb72baf13e..cb2e1f96f6e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -708,27 +708,6 @@ GDBRemoteCommunicationServer::Handle_qSpeedTest (StringExtractorGDBRemote &packe return SendErrorResponse (7); } - -static void * -AcceptPortFromInferior (void *arg) -{ - const char *connect_url = (const char *)arg; - ConnectionFileDescriptor file_conn; - Error error; - if (file_conn.Connect (connect_url, &error) == eConnectionStatusSuccess) - { - char pid_str[256]; - ::memset (pid_str, 0, sizeof(pid_str)); - ConnectionStatus status; - const size_t pid_str_len = file_conn.Read (pid_str, sizeof(pid_str), 0, status, NULL); - if (pid_str_len > 0) - { - int pid = atoi (pid_str); - return (void *)(intptr_t)pid; - } - } - return NULL; -} // //static bool //WaitForProcessToSIGSTOP (const lldb::pid_t pid, const int timeout_in_seconds) diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index bc9163f7f71..4e34a9a09a0 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -166,8 +166,6 @@ namespace { } // anonymous namespace end -static bool rand_initialized = false; - // TODO Randomly assigning a port is unsafe. We should get an unused // ephemeral port from the kernel and make sure we reserve it before passing // it to debugserver. @@ -180,19 +178,22 @@ static bool rand_initialized = false; #define HIGH_PORT (49151u) #endif +#if defined(__APPLE__) && defined(__arm__) +static bool rand_initialized = false; + static inline uint16_t get_random_port () { if (!rand_initialized) { time_t seed = time(NULL); - + rand_initialized = true; srand(seed); } return (rand() % (HIGH_PORT - LOW_PORT)) + LOW_PORT; } - +#endif lldb_private::ConstString ProcessGDBRemote::GetPluginNameStatic() |