Skip to content

Commit 029adf4

Browse files
DavidSpicketttstellar
authored andcommitted
Prevent TestqOffsets.py picking up host binaries
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, return something to LLDB that tells it there is no remote PID, preventing the host lookup. Fixes #155895
1 parent a77d804 commit 029adf4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ class Responder(MockGDBServerResponder):
1010
def qOffsets(self):
1111
return "Text=470000;Data=470000"
1212

13+
def qfThreadInfo(self):
14+
# Prevent LLDB defaulting to PID of 1 and looking up some other
15+
# process when on an AArch64 host.
16+
return "m-1"
17+
1318
def test(self):
1419
self.server.responder = TestqOffsets.Responder()
1520
target = self.createTarget("qOffsets.yaml")

0 commit comments

Comments
 (0)