@@ -875,22 +875,22 @@ SwiftASTContextSupportsLanguage(lldb::LanguageType language) {
875
875
return language == eLanguageTypeSwift;
876
876
}
877
877
878
- static bool IsDeviceSupport (const char * path) {
878
+ static bool IsDeviceSupport (StringRef path) {
879
879
// The old-style check, which we preserve for safety.
880
- if (path && strstr (path, " iOS DeviceSupport" ))
880
+ if (path. contains ( " iOS DeviceSupport" ))
881
881
return true ;
882
882
883
883
// The new-style check, which should cover more devices.
884
- if (path)
885
- if ( const char *Developer_Xcode = strstr (path, " Developer " ))
886
- if ( const char *DeviceSupport = strstr (Developer_Xcode, " DeviceSupport" ))
887
- if (strstr ( DeviceSupport, " Symbols" ))
888
- return true ;
884
+ StringRef Developer = path. substr (path. find ( " Developer " ));
885
+ StringRef DeviceSupport =
886
+ Developer. substr (Developer. find ( " DeviceSupport" ));
887
+ if (DeviceSupport. contains ( " Symbols" ))
888
+ return true ;
889
889
890
890
// Don't look in the simulator runtime frameworks either. They
891
891
// either duplicate what the SDK has, or for older simulators
892
892
// conflict with them.
893
- if (path && strstr (path, " .simruntime/Contents/Resources/" ))
893
+ if (path. contains ( " .simruntime/Contents/Resources/" ))
894
894
return true ;
895
895
896
896
return false ;
@@ -2012,13 +2012,14 @@ ProcessModule(ModuleSP module_sp, std::string m_description,
2012
2012
// framework_offset now points to the '/';
2013
2013
2014
2014
std::string parent_path = module_path.substr (0 , framework_offset);
2015
-
2016
- // Never add framework paths pointing into the
2017
- // system. These modules must be imported from the
2018
- // SDK instead.
2019
- if (!StringRef (parent_path).startswith (" /System/Library" ) &&
2020
- !IsDeviceSupport (parent_path.c_str ())) {
2021
- LOG_PRINTF (GetLog (LLDBLog::Types), " adding framework path \" %s\" ." ,
2015
+ StringRef p (parent_path);
2016
+
2017
+ // Never add framework paths pointing into the system. These
2018
+ // modules must be imported from the SDK instead.
2019
+ if (!p.startswith (" /System/Library" ) && !IsDeviceSupport (p) &&
2020
+ !p.startswith (
2021
+ " /Library/Apple/System/Library/PrivateFrameworks" )) {
2022
+ LOG_PRINTF (GetLog (LLDBLog::Types), " adding framework path \" %s\" /.. ." ,
2022
2023
framework_path.c_str ());
2023
2024
framework_search_paths.push_back (
2024
2025
{std::move (parent_path), /* system*/ false });
0 commit comments