[Lldb-commits] [lldb] 2b61b77 - [lldb] Make TestModuleLoadedNotifys work with dyld from the shared cache

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 3 14:32:44 PDT 2022


Author: Jonas Devlieghere
Date: 2022-08-03T14:24:42-07:00
New Revision: 2b61b770df813539b38b620efcae8fd3d11faad2

URL: https://github.com/llvm/llvm-project/commit/2b61b770df813539b38b620efcae8fd3d11faad2
DIFF: https://github.com/llvm/llvm-project/commit/2b61b770df813539b38b620efcae8fd3d11faad2.diff

LOG: [lldb] Make TestModuleLoadedNotifys work with dyld from the shared cache

Make TestModuleLoadedNotifys work with a dyld from the expanded shared
cache in the DeviceSupport directory. In that case the module path is:

  ~/Library/Developer/Xcode/iOS DeviceSupport/<...>/Symbols/usr/lib/dyld

instead of just:

  /usr/lib/dyld

This makes the test pass when running against an embedded Darwin device.

Added: 
    

Modified: 
    lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py b/lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py
index 06169b041d374..7f26e5e53a40d 100644
--- a/lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py
+++ b/lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py
@@ -82,8 +82,10 @@ def test_launch_notifications(self):
                         module = lldb.SBTarget.GetModuleAtIndexFromEvent(i, event)
                         # 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 not in ['/usr/lib/dyld', exe]:
+                        # shared cache. Use the basename so this also works
+                        # when reading dyld from the expanded shared cache.
+                        exe_basename = lldb.SBFileSpec(exe).basename
+                        if module.file.basename not in ['dyld', exe_basename]:
                             self.assertTrue(module not in already_loaded_modules, '{} is already loaded'.format(module))
                         already_loaded_modules.append(module)
                         if self.TraceOn():


        


More information about the lldb-commits mailing list