[Lldb-commits] [lldb] [lldb] Fix TestGlobalModuleCache.py for remote debugging (PR #111483)

via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 7 22:16:01 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Igor Kudrin (igorkudrin)

<details>
<summary>Changes</summary>

`SBDebugger().Create()` returns a debugger with only the host platform in its platform list. If the test suite is running for a remote platform, it should be explicitly added and selected in the new debugger created within the test, otherwise, the test will fail because the host platform may not be able to launch the built binary.

---
Full diff: https://github.com/llvm/llvm-project/pull/111483.diff


1 Files Affected:

- (modified) lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py (+2) 


``````````diff
diff --git a/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py b/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
index ccefc28946e062..16bc86bd4fc44d 100644
--- a/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
+++ b/lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
@@ -111,6 +111,8 @@ def do_test(self, one_target, one_debugger):
         else:
             if one_target:
                 new_debugger = lldb.SBDebugger().Create()
+                if lldb.selected_platform is not None:
+                    new_debugger.SetSelectedPlatform(lldb.selected_platform)
                 new_debugger.SetAsync(False)
                 self.old_debugger = self.dbg
                 self.dbg = new_debugger

``````````

</details>


https://github.com/llvm/llvm-project/pull/111483


More information about the lldb-commits mailing list