[Lldb-commits] [lldb] 157e886 - [lldb][test] Prevent TestqOffsets.py picking up host binaries (#157432)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 9 01:30:33 PDT 2025
Author: David Spickett
Date: 2025-09-09T09:30:29+01:00
New Revision: 157e88637475b831e175b75f30cab9dd63eaeae1
URL: https://github.com/llvm/llvm-project/commit/157e88637475b831e175b75f30cab9dd63eaeae1
DIFF: https://github.com/llvm/llvm-project/commit/157e88637475b831e175b75f30cab9dd63eaeae1.diff
LOG: [lldb][test] Prevent TestqOffsets.py picking up host binaries (#157432)
Due to a fallback in GDBRemoteCommunicationClient.cpp, on Linux we will
assume a PID of 1 if the remote does not respond in some way that tells
us the real PID.
So if PID 1 happened to be a process that the current user could read,
we would try to debug that instead. On my current machine, PID 1 was
sshd run by root so we would ignore it. If I changed the fallback to
some process ID run by my user, the test would fail.
To prevent this, select the remote-linux platform before creating the
target. This means we won't attempt any host lookups.
Fixes #155895
Added:
Modified:
lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
Removed:
################################################################################
diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py b/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
index a1adc20e864ba..629361c6ae5b8 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
@@ -12,6 +12,8 @@ def qOffsets(self):
def test(self):
self.server.responder = TestqOffsets.Responder()
+ # This ensures that we do not pick up any binaries on the host.
+ self.runCmd("platform select remote-linux")
target = self.createTarget("qOffsets.yaml")
text = target.modules[0].FindSection(".text")
self.assertEqual(text.GetLoadAddress(target), lldb.LLDB_INVALID_ADDRESS)
More information about the lldb-commits
mailing list