]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / tools / lldb-server / inferior-crash / TestGdbRemoteAbort.py
1 from __future__ import print_function
2
3
4
5 import gdbremote_testcase
6 import signal
7 from lldbsuite.test.lldbtest import *
8
9 class TestGdbRemoteAbort(gdbremote_testcase.GdbRemoteTestCaseBase):
10     mydir = TestBase.compute_mydir(__file__)
11
12     def inferior_abort_received(self):
13         procs = self.prep_debug_monitor_and_inferior(inferior_args=["abort"])
14         self.assertIsNotNone(procs)
15
16         self.test_sequence.add_log_lines([
17             "read packet: $vCont;c#a8",
18             {"direction":"send", "regex":r"^\$T([0-9a-fA-F]{2}).*#[0-9a-fA-F]{2}$", "capture":{ 1:"hex_exit_code"} },
19             ], True)
20
21         context = self.expect_gdbremote_sequence()
22         self.assertIsNotNone(context)
23
24         hex_exit_code = context.get("hex_exit_code")
25         self.assertIsNotNone(hex_exit_code)
26         self.assertEqual(int(hex_exit_code, 16),
27                           lldbutil.get_signal_number('SIGABRT'))
28
29     @debugserver_test
30     def test_inferior_abort_received_debugserver(self):
31         self.init_debugserver_test()
32         self.build()
33         self.inferior_abort_received()
34
35     @llgs_test
36     # std::abort() on <= API 16 raises SIGSEGV - b.android.com/179836
37     @expectedFailureAndroid(api_levels=list(range(16 + 1)))
38     def test_inferior_abort_received_llgs(self):
39         self.init_llgs_test()
40         self.build()
41         self.inferior_abort_received()
42