summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp11
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h12
-rw-r--r--lldb/source/Utility/ArchSpec.cpp5
3 files changed, 15 insertions, 13 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 886e3b6d9a0..1665448fc5b 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -1402,14 +1402,11 @@ bool PlatformDarwin::SDKSupportsModules(SDKType desired_type,
if (last_path_component) {
const llvm::StringRef sdk_name = last_path_component.GetStringRef();
- llvm::StringRef version_part;
-
- if (sdk_name.startswith(sdk_strings[(int)desired_type])) {
- version_part =
- sdk_name.drop_front(strlen(sdk_strings[(int)desired_type]));
- } else {
+ if (!sdk_name.startswith(sdk_strings[(int)desired_type]))
return false;
- }
+ auto version_part =
+ sdk_name.drop_front(strlen(sdk_strings[(int)desired_type]));
+ version_part.consume_back(".sdk");
llvm::VersionTuple version;
if (version.tryParse(version_part))
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
index 3ad29ec1a0b..60603103a9e 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
@@ -85,6 +85,12 @@ public:
static std::tuple<llvm::VersionTuple, llvm::StringRef>
ParseVersionBuildDir(llvm::StringRef str);
+ enum class SDKType {
+ MacOSX = 0,
+ iPhoneSimulator,
+ iPhoneOS,
+ };
+
protected:
void ReadLibdispatchOffsetsAddress(lldb_private::Process *process);
@@ -95,12 +101,6 @@ protected:
const lldb_private::FileSpecList *module_search_paths_ptr,
lldb::ModuleSP *old_module_sp_ptr, bool *did_create_ptr);
- enum class SDKType {
- MacOSX = 0,
- iPhoneSimulator,
- iPhoneOS,
- };
-
static bool SDKSupportsModules(SDKType sdk_type, llvm::VersionTuple version);
static bool SDKSupportsModules(SDKType desired_type,
diff --git a/lldb/source/Utility/ArchSpec.cpp b/lldb/source/Utility/ArchSpec.cpp
index df1029e7c6d..26f1421f657 100644
--- a/lldb/source/Utility/ArchSpec.cpp
+++ b/lldb/source/Utility/ArchSpec.cpp
@@ -1029,6 +1029,11 @@ static bool isCompatibleEnvironment(llvm::Triple::EnvironmentType lhs,
rhs == llvm::Triple::UnknownEnvironment)
return true;
+ // If any of the environment is unknown then they are compatible
+ if (lhs == llvm::Triple::UnknownEnvironment ||
+ rhs == llvm::Triple::UnknownEnvironment)
+ return true;
+
// If one of the environment is Android and the other one is EABI then they
// are considered to be compatible. This is required as a workaround for
// shared libraries compiled for Android without the NOTE section indicating
OpenPOWER on IntegriCloud