diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2014-07-22 23:41:36 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2014-07-22 23:41:36 +0000 |
commit | 015d818b59dbdadc2726adc6132be1b3da4d6387 (patch) | |
tree | 208664b1730e431210c5353d12f0e71b619fec65 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | |
parent | c90a85ff995b9fb9faefecba2304e68f4d8e5d95 (diff) | |
download | llvm-015d818b59dbdadc2726adc6132be1b3da4d6387.zip llvm-015d818b59dbdadc2726adc6132be1b3da4d6387.tar.gz llvm-015d818b59dbdadc2726adc6132be1b3da4d6387.tar.bz2 |
Enable lldb-platform exe support for Linux.
This change enables lldb-platform for Linux. In addition, it does the following:
* fixes Host::GetLLDBPath() to work on Linux/*BSD for ePathTypeSupportExecutableDir-relative paths.
* adds more logging and comments around lldb-platform startup and remote lldb-platform usage.
* refactors lldb-platform remote-* support for Darwin and Linux into PlatformPOSIX. This, in theory, is the bulk of what is needed for *BSD to make remote connections to lldb-platform as well (although I haven't tested that yet). FreeBSD can make similar changes to their Platform* as was made here for PlatformLinux to pick up the rest of the bits.
* teaches GDBRemoteCommunication to use lldb-gdbserver for non-Apple hosts.
llvm-svn: 213707
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index d3ab3b8..be90eb2 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -29,7 +29,11 @@ // Project includes #include "ProcessGDBRemoteLog.h" -#define DEBUGSERVER_BASENAME "debugserver" +#if defined(__APPLE__) +# define DEBUGSERVER_BASENAME "debugserver" +#else +# define DEBUGSERVER_BASENAME "lldb-gdbserver" +#endif using namespace lldb; using namespace lldb_private; @@ -650,6 +654,10 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, lldb_private::ProcessLaunchInfo &launch_info, uint16_t &out_port) { + Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS)); + if (log) + log->Printf ("GDBRemoteCommunication::%s(hostname=%s, in_port=%" PRIu16 ", out_port=%" PRIu16, __FUNCTION__, hostname ? hostname : "<empty>", in_port, out_port); + out_port = in_port; Error error; // If we locate debugserver, keep that located version around @@ -662,7 +670,11 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, // to the debugserver to use and use it if we do. const char *env_debugserver_path = getenv("LLDB_DEBUGSERVER_PATH"); if (env_debugserver_path) + { debugserver_file_spec.SetFile (env_debugserver_path, false); + if (log) + log->Printf ("GDBRemoteCommunication::%s() gdb-remote stub exe path set from environment variable: %s", __FUNCTION__, env_debugserver_path); + } else debugserver_file_spec = g_debugserver_file_spec; bool debugserver_exists = debugserver_file_spec.Exists(); @@ -676,10 +688,16 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, debugserver_exists = debugserver_file_spec.Exists(); if (debugserver_exists) { + if (log) + log->Printf ("GDBRemoteCommunication::%s() found gdb-remote stub exe '%s'", __FUNCTION__, debugserver_file_spec.GetPath ().c_str ()); + g_debugserver_file_spec = debugserver_file_spec; } else { + if (log) + log->Printf ("GDBRemoteCommunication::%s() could not find gdb-remote stub exe '%s'", __FUNCTION__, debugserver_file_spec.GetPath ().c_str ()); + g_debugserver_file_spec.Clear(); debugserver_file_spec.Clear(); } |