Index: lldb/test/API/tools/lldb-server/TestGdbRemote_vContThreads.py =================================================================== --- lldb/test/API/tools/lldb-server/TestGdbRemote_vContThreads.py +++ lldb/test/API/tools/lldb-server/TestGdbRemote_vContThreads.py @@ -31,6 +31,28 @@ self.reset_test_sequence() return threads + @expectedFailureNetBSD + def test_signal_process_without_tid(self): + self.build() + self.set_inferior_startup_launch() + + threads = self.start_threads(1) + self.test_sequence.add_log_lines([ + "read packet: $vCont;C{0:x}#00".format( + lldbutil.get_signal_number('SIGUSR1')), + {"type": "output_match", + "regex": self.maybe_strict_output_regex( + r"received SIGUSR1 on thread id: ([0-9a-f]+)\r\n" + r"received SIGUSR1 on thread id: ([0-9a-f]+)\r\n"), + "capture": {1: "tid1", 2: "tid2"}, + }, + ], True) + + context = self.expect_gdbremote_sequence() + self.assertIsNotNone(context) + tids = sorted(int(context[x], 16) for x in ("tid1", "tid2")) + self.assertEqual(tids, sorted(threads)) + @skipUnlessPlatform(["netbsd"]) @expectedFailureNetBSD def test_signal_one_thread(self): @@ -42,13 +64,17 @@ self.test_sequence.add_log_lines([ "read packet: $vCont;C{0:x}:{1:x};c#00".format( lldbutil.get_signal_number('SIGUSR1'), threads[0]), - {"direction": "send", "regex": r"^\$W00#b7$"}, + {"type": "output_match", + "regex": self.maybe_strict_output_regex( + r"received SIGUSR1 on thread id: ([0-9a-f]+)\r\n"), + "capture": {1: "tid"}, + }, ], True) context = self.expect_gdbremote_sequence() self.assertIsNotNone(context) + self.assertEqual(int(context["tid"], 16), threads[0]) - @skipUnlessPlatform(["netbsd"]) @expectedFailureNetBSD def test_signal_all_threads(self): self.build() @@ -60,11 +86,18 @@ "read packet: $vCont;C{0:x}:{1:x};C{0:x}:{2:x}#00".format( lldbutil.get_signal_number('SIGUSR1'), threads[0], threads[1]), - {"direction": "send", "regex": r"^\$W00#b7$"}, + {"type": "output_match", + "regex": self.maybe_strict_output_regex( + r"received SIGUSR1 on thread id: ([0-9a-f]+)\r\n" + r"received SIGUSR1 on thread id: ([0-9a-f]+)\r\n"), + "capture": {1: "tid1", 2: "tid2"}, + }, ], True) context = self.expect_gdbremote_sequence() self.assertIsNotNone(context) + tids = sorted(int(context[x], 16) for x in ("tid1", "tid2")) + self.assertEqual(tids, sorted(threads)) @skipUnlessPlatform(["netbsd"]) def test_signal_two_of_three_threads(self):