1 from __future__ import print_function
5 import gdbremote_testcase
7 from lldbsuite.test.lldbtest import *
9 class TestGdbRemoteAbort(gdbremote_testcase.GdbRemoteTestCaseBase):
10 mydir = TestBase.compute_mydir(__file__)
12 def inferior_abort_received(self):
13 procs = self.prep_debug_monitor_and_inferior(inferior_args=["abort"])
14 self.assertIsNotNone(procs)
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"} },
21 context = self.expect_gdbremote_sequence()
22 self.assertIsNotNone(context)
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'))
30 def test_inferior_abort_received_debugserver(self):
31 self.init_debugserver_test()
33 self.inferior_abort_received()
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):
41 self.inferior_abort_received()