1 import gdbremote_testcase
2 from lldbsuite
.test
.decorators
import *
3 from lldbsuite
.test
.lldbtest
import *
4 from lldbsuite
.test
import lldbutil
7 class TestGdbRemoteAbort(gdbremote_testcase
.GdbRemoteTestCaseBase
):
8 @skipIfWindows # No signal is sent on Windows.
9 # std::abort() on <= API 16 raises SIGSEGV - b.android.com/179836
10 @expectedFailureAndroid(api_levels
=list(range(16 + 1)))
11 def test_inferior_abort_received_llgs(self
):
14 procs
= self
.prep_debug_monitor_and_inferior(inferior_args
=["abort"])
15 self
.assertIsNotNone(procs
)
17 self
.test_sequence
.add_log_lines(
19 "read packet: $vCont;c#a8",
22 "regex": r
"^\$T([0-9a-fA-F]{2}).*#[0-9a-fA-F]{2}$",
23 "capture": {1: "hex_exit_code"},
29 context
= self
.expect_gdbremote_sequence()
30 self
.assertIsNotNone(context
)
32 hex_exit_code
= context
.get("hex_exit_code")
33 self
.assertIsNotNone(hex_exit_code
)
34 self
.assertEqual(int(hex_exit_code
, 16), lldbutil
.get_signal_number("SIGABRT"))