diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2015-11-04 18:10:31 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2015-11-04 18:10:31 +0000 |
commit | e028e4e3bbfe631b62f9c0127777ed9c56dfc4b7 (patch) | |
tree | e445e901c61d14a778a2695c92e09e8767b81359 | |
parent | d8078ffcfc93a6c08e0795029538fb064dd2d768 (diff) | |
download | bcm5719-llvm-e028e4e3bbfe631b62f9c0127777ed9c56dfc4b7.tar.gz bcm5719-llvm-e028e4e3bbfe631b62f9c0127777ed9c56dfc4b7.zip |
OS X: fix the Xcode debugserver lookup code when LLDB.framework does not contain a debugserver
LLDB recently started supporting LLDB.framework without a
debugserver in it. When that happens, the Xcode-included debugserver
is searched for and used. This change fixes the code that looks for
Xcode when the housing process is not Xcode. In particular, this
addresses the problem where python is running the test suite and
the LLDB.framework does not contain a debugserver.
llvm-svn: 252059
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index f75ca1b12dc..8c1b820b05c 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -10,7 +10,10 @@ #include "PlatformDarwin.h" // C Includes +#include <string.h> + // C++ Includes +#include <algorithm> #include <mutex> // Other libraries and framework includes @@ -1245,7 +1248,13 @@ GetXcodeContentsPath () if (fspec) { - g_xcode_filespec = CheckPathForXcode(fspec); + // Ignore the current binary if it is python. + std::string basename_lower = fspec.GetFilename ().GetCString (); + std::transform(basename_lower.begin (), basename_lower.end (), basename_lower.begin (), tolower); + if (basename_lower != "python") + { + g_xcode_filespec = CheckPathForXcode(fspec); + } } // Next check DEVELOPER_DIR environment variable @@ -1263,7 +1272,7 @@ GetXcodeContentsPath () int status = 0; int signo = 0; std::string output; - const char *command = "xcrun -sdk macosx --show-sdk-path"; + const char *command = "/usr/bin/xcode-select -p"; lldb_private::Error error = Host::RunShellCommand (command, // shell command to run NULL, // current working directory &status, // Put the exit status of the process in here @@ -1277,6 +1286,7 @@ GetXcodeContentsPath () { output.erase(first_non_newline+1); } + output.append("/.."); g_xcode_filespec = CheckPathForXcode(FileSpec(output.c_str(), false)); } |