Skip to content

[lldb] Fix TestGlobalModuleCache.py for remote debugging #111483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 10, 2024

Conversation

igorkudrin
Copy link
Collaborator

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.

`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.
@llvmbot
Copy link
Member

llvmbot commented Oct 8, 2024

@llvm/pr-subscribers-lldb

Author: Igor Kudrin (igorkudrin)

Changes

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 --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

@igorkudrin igorkudrin merged commit 68a5f5d into llvm:main Oct 10, 2024
7 checks passed
@igorkudrin igorkudrin deleted the lldb-fix-TestGlobalModuleCache branch October 10, 2024 01:11
DanielCChen pushed a commit to DanielCChen/llvm-project that referenced this pull request Oct 16, 2024
`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants