-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[lldb] Fixed the TestDebuggerAPI test on x86_64 Windows host #90580
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
Conversation
…stDebuggerAPI.py It is necessary to select the expected platform at the beginning. In case of `Windows` host platform1.GetName() returned `host`. platform2.GetName() returned `remote-linux`, but platform2.GetWorkingDirectory() was None and finally ``` File "llvm-project\lldb\test\API\python_api\debugger\TestDebuggerAPI.py", line 108, in test_CreateTarget_platform platform2.GetWorkingDirectory().endswith("bar"), AttributeError: 'NoneType' object has no attribute 'endswith' ```
@llvm/pr-subscribers-lldb Author: Dmitry Vasilyev (slydiman) ChangesIt is necessary to select the expected platform at the beginning. In case of
Full diff: https://github.com/llvm/llvm-project/pull/90580.diff 1 Files Affected:
diff --git a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
index 522de2466012ed..3d6484e5c9fbc4 100644
--- a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
+++ b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py
@@ -95,6 +95,7 @@ def test_CreateTarget_platform(self):
exe = self.getBuildArtifact("a.out")
self.yaml2obj("elf.yaml", exe)
error = lldb.SBError()
+ self.dbg.SetSelectedPlatform(lldb.SBPlatform("remote-linux"))
target1 = self.dbg.CreateTarget(exe, None, "remote-linux", False, error)
self.assertSuccess(error)
platform1 = target1.GetPlatform()
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right thing to do. SBDebugger::CreateTarget
takes a platform_name
argument which we're already setting to "remote-linux". If target1.GetPlatform()
doesn't return the SBPlatform for remote-linux
then I would think that's the actual bug.
Probably it works on buildbots because the host architecture is
platform_options contains platform_arch is updated to
and platform_sp is updated to
Next call
I don't think we need to change this logic. So the fix of this test looks reasonable. |
I think you've laid out the events that happen nicely but I came to the opposite conclusion. I still don't think this is the right fix. We have buildbots running on x86_64 and it works there too. I don't think this test working on AArch64 machines is related. The platform architecture getting set to x86_64 makes sense to me because the ELF is built as an x86_64 binary. However, the platform_sp getting set to |
FWIW, I agree with @bulbazord. If the user specifies an explicit platform in the CreateTarget function, that platform should really take precedence over anything else. |
I have added the issue #92419 and updated the test with @expectedFailureAll and the bugnumber for now. |
We are almost done with configuring the buildbot for cross lldb (Windows x86_64 host and Linux Aarch64 target). We are trying to get it green with minimal local patches. |
Disable the TestDebuggerAPI test in case of the remote target and Windows host. It is related to #92419.