ted updated this revision to Diff 374233.
ted added a comment.
Remove unneeded prints from test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109937/new/
https://reviews.llvm.org/D109937
Files:
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py
Index:
lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py
===================================================================
--- /dev/null
+++
lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py
@@ -0,0 +1,27 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+
+class TestThreadInfoTrailingComma(GDBRemoteTestBase):
+
+ def test(self):
+ class MyResponder(MockGDBServerResponder):
+ def haltReason(self):
+ return "T02thread:1"
+
+ def qfThreadInfo(self):
+ return "m1,2,3,4,"
+
+ self.server.responder = MyResponder()
+ target = self.dbg.CreateTarget('')
+ if self.TraceOn():
+ self.runCmd("log enable gdb-remote packets")
+ self.addTearDownHook(
+ lambda: self.runCmd("log disable gdb-remote packets"))
+ process = self.connect(target)
+ self.assertEqual(process.GetThreadAtIndex(0).GetThreadID(), 1)
+ self.assertEqual(process.GetThreadAtIndex(1).GetThreadID(), 2)
+ self.assertEqual(process.GetThreadAtIndex(2).GetThreadID(), 3)
+ self.assertEqual(process.GetThreadAtIndex(3).GetThreadID(), 4)
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2906,8 +2906,12 @@
if (ch == 'm') {
do {
auto pid_tid = response.GetPidTid(LLDB_INVALID_PROCESS_ID);
+ // If we get an invalid response, break out of the loop.
+ // If there are valid tids, they have been added to ids.
+ // If there are no valid tids, we'll fall through to the
+ // bare-iron target handling below.
if (!pid_tid)
- return {};
+ break;
ids.push_back(pid_tid.getValue());
ch = response.GetChar(); // Skip the command separator
Index: lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py
===================================================================
--- /dev/null
+++ lldb/test/API/functionalities/gdb_remote_client/TestThreadInfoTrailingComma.py
@@ -0,0 +1,27 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+
+class TestThreadInfoTrailingComma(GDBRemoteTestBase):
+
+ def test(self):
+ class MyResponder(MockGDBServerResponder):
+ def haltReason(self):
+ return "T02thread:1"
+
+ def qfThreadInfo(self):
+ return "m1,2,3,4,"
+
+ self.server.responder = MyResponder()
+ target = self.dbg.CreateTarget('')
+ if self.TraceOn():
+ self.runCmd("log enable gdb-remote packets")
+ self.addTearDownHook(
+ lambda: self.runCmd("log disable gdb-remote packets"))
+ process = self.connect(target)
+ self.assertEqual(process.GetThreadAtIndex(0).GetThreadID(), 1)
+ self.assertEqual(process.GetThreadAtIndex(1).GetThreadID(), 2)
+ self.assertEqual(process.GetThreadAtIndex(2).GetThreadID(), 3)
+ self.assertEqual(process.GetThreadAtIndex(3).GetThreadID(), 4)
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2906,8 +2906,12 @@
if (ch == 'm') {
do {
auto pid_tid = response.GetPidTid(LLDB_INVALID_PROCESS_ID);
+ // If we get an invalid response, break out of the loop.
+ // If there are valid tids, they have been added to ids.
+ // If there are no valid tids, we'll fall through to the
+ // bare-iron target handling below.
if (!pid_tid)
- return {};
+ break;
ids.push_back(pid_tid.getValue());
ch = response.GetChar(); // Skip the command separator
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits