[Lldb-commits] [lldb] [lldb][test] Prevent TestqOffsets.py picking up host binaries (PR #157432)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 8 04:49:03 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: David Spickett (DavidSpickett)
<details>
<summary>Changes</summary>
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
---
Full diff: https://github.com/llvm/llvm-project/pull/157432.diff
1 Files Affected:
- (modified) lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py (+5)
``````````diff
diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py b/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
index a1adc20e864ba..e069f10b19e1e 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
@@ -10,6 +10,11 @@ class Responder(MockGDBServerResponder):
def qOffsets(self):
return "Text=470000;Data=470000"
+ def qfThreadInfo(self):
+ # Prevent LLDB defaulting to PID of 1 and looking up some other
+ # process when on an AArch64 host.
+ return "m-1"
+
def test(self):
self.server.responder = TestqOffsets.Responder()
target = self.createTarget("qOffsets.yaml")
``````````
</details>
https://github.com/llvm/llvm-project/pull/157432
More information about the lldb-commits
mailing list