This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with `black` (23.1.0). If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run `git checkout --ours <yourfile>` and then reformat it with black. RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential revision: https://reviews.llvm.org/D151460
27 lines
1.0 KiB
Python
27 lines
1.0 KiB
Python
import lldb
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.gdbclientutils import *
|
|
from lldbsuite.test.lldbgdbclient import GDBRemoteTestBase
|
|
|
|
|
|
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)
|