diff options
author | Greg Clayton <gclayton@apple.com> | 2015-10-19 20:44:01 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2015-10-19 20:44:01 +0000 |
commit | 6988abc14d42e992ee699cee96cfe2095bdf2d24 (patch) | |
tree | 9378c6f5c2e62be9ad67e199a46c77098627b7e8 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | |
parent | 238de51eed3986f29bca1f903926f41fadd3463d (diff) | |
download | llvm-6988abc14d42e992ee699cee96cfe2095bdf2d24.zip llvm-6988abc14d42e992ee699cee96cfe2095bdf2d24.tar.gz llvm-6988abc14d42e992ee699cee96cfe2095bdf2d24.tar.bz2 |
Allow LLDB.framework to locate debugserver even when it doesn't exist in the LLDB.framework.
This allows open source MacOSX clients to not have to build debugserver and the current LLDB can find debugserver inside the selected Xcode.app on your system.
<rdar://problem/23167253>
llvm-svn: 250735
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index e5ea80f..0bbee85 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -30,6 +30,7 @@ #include "lldb/Host/StringConvert.h" #include "lldb/Host/ThreadLauncher.h" #include "lldb/Host/TimeValue.h" +#include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "llvm/ADT/SmallString.h" @@ -1113,6 +1114,7 @@ GDBRemoteCommunication::ListenThread (lldb::thread_arg_t arg) Error GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, uint16_t in_port, + Platform *platform, ProcessLaunchInfo &launch_info, uint16_t &out_port) { @@ -1157,11 +1159,20 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, } else { - if (log) - log->Printf ("GDBRemoteCommunication::%s() could not find gdb-remote stub exe '%s'", __FUNCTION__, debugserver_file_spec.GetPath ().c_str ()); - + debugserver_file_spec = platform->LocateExecutable(DEBUGSERVER_BASENAME); + if (debugserver_file_spec) + { + // Platform::LocateExecutable() wouldn't return a path if it doesn't exist + debugserver_exists = true; + } + else + { + if (log) + log->Printf ("GDBRemoteCommunication::%s() could not find gdb-remote stub exe '%s'", __FUNCTION__, debugserver_file_spec.GetPath ().c_str ()); + } + // Don't cache the platform specific GDB server binary as it could change + // from platform to platform g_debugserver_file_spec.Clear(); - debugserver_file_spec.Clear(); } } } |