JDevlieghere created this revision. JDevlieghere added a reviewer: jasonmolenda. Herald added a project: All. JDevlieghere requested review of this revision.
On macOS Ventura and later, dyld and the main binary will be loaded again when dyld moves itself into the shared cache. Update the test accordingly. https://reviews.llvm.org/D127331 Files: lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py Index: lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py =================================================================== --- lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py +++ lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py @@ -80,14 +80,17 @@ total_modules_added_events += 1 total_solibs_added += solib_count added_files = [] - i = 0 - while i < solib_count: + for i in range (solib_count): module = lldb.SBTarget.GetModuleAtIndexFromEvent(i, event) - self.assertTrue(module not in already_loaded_modules) + # On macOS Ventura and later, dyld and the main binary + # will be loaded again when dyld moves itself into the + # shared cache. + if module.file.fullpath in ['/usr/lib/dyld', exe]: + continue + self.assertTrue(module not in already_loaded_modules, '{} is already loaded'.format(module)) already_loaded_modules.append(module) if self.TraceOn(): added_files.append(module.GetFileSpec().GetFilename()) - i = i + 1 if self.TraceOn(): # print all of the binaries that have been added print("Loaded files: %s" % (', '.join(added_files)))
Index: lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py =================================================================== --- lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py +++ lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py @@ -80,14 +80,17 @@ total_modules_added_events += 1 total_solibs_added += solib_count added_files = [] - i = 0 - while i < solib_count: + for i in range (solib_count): module = lldb.SBTarget.GetModuleAtIndexFromEvent(i, event) - self.assertTrue(module not in already_loaded_modules) + # On macOS Ventura and later, dyld and the main binary + # will be loaded again when dyld moves itself into the + # shared cache. + if module.file.fullpath in ['/usr/lib/dyld', exe]: + continue + self.assertTrue(module not in already_loaded_modules, '{} is already loaded'.format(module)) already_loaded_modules.append(module) if self.TraceOn(): added_files.append(module.GetFileSpec().GetFilename()) - i = i + 1 if self.TraceOn(): # print all of the binaries that have been added print("Loaded files: %s" % (', '.join(added_files)))
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits