2 import gdbremote_testcase
3 from lldbsuite.test.decorators import *
4 from lldbsuite.test.lldbtest import *
5 from lldbsuite.test import lldbutil
8 class TestGdbRemoteThreadName(gdbremote_testcase.GdbRemoteTestCaseBase):
10 mydir = TestBase.compute_mydir(__file__)
12 def run_and_check_name(self, expected_name):
13 self.test_sequence.add_log_lines(["read packet: $vCont;c#a8",
16 r"^\$T([0-9a-fA-F]{2})([^#]+)#[0-9a-fA-F]{2}$",
23 context = self.expect_gdbremote_sequence()
24 self.assertIsNotNone(context)
26 sigint = lldbutil.get_signal_number("SIGINT")
27 self.assertEqual(sigint, int(context.get("signal"), 16))
28 kv_dict = self.parse_key_val_dict(context.get("key_vals_text"))
29 self.assertEqual(expected_name, kv_dict.get("name"))
31 @skipIfWindows # the test is not updated for Windows.
34 """ Make sure lldb-server can retrieve inferior thread name"""
37 self.set_inferior_startup_launch()
38 procs = self.prep_debug_monitor_and_inferior()
40 self.run_and_check_name("hello world")
41 self.run_and_check_name("goodbye world")