summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-08-29 20:32:18 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-08-29 20:32:18 +0000
commit541252402559388dd633dfb7ff2df6433544ec61 (patch)
treef45f9085f6cb6c4e30064563299f3bdb6e54a1ae
parent3b230089877eaf44ae1452afe358d85b0538db46 (diff)
downloadbcm5719-llvm-541252402559388dd633dfb7ff2df6433544ec61.tar.gz
bcm5719-llvm-541252402559388dd633dfb7ff2df6433544ec61.zip
Fix a test broken by r216564.
llgs Linux is no longer doing the translation to some gdb fixed signal numbers. This change modifies the test method to take in the signo expected for a segfault. The debugserver test uses the fixed gdb number, and everything else uses signal.SIGSEGV for the platform. Sidenote: I somehow did not see this reported in multicore tests. I will need to verify that we aren't missing test failures in that script. I need to verify why this wasn't more obvious with test/dosep.py. llvm-svn: 216770
-rw-r--r--lldb/test/tools/lldb-gdbserver/TestLldbGdbServer.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/test/tools/lldb-gdbserver/TestLldbGdbServer.py b/lldb/test/tools/lldb-gdbserver/TestLldbGdbServer.py
index 718cff094d2..fe121bb0828 100644
--- a/lldb/test/tools/lldb-gdbserver/TestLldbGdbServer.py
+++ b/lldb/test/tools/lldb-gdbserver/TestLldbGdbServer.py
@@ -13,6 +13,7 @@ the initial set of tests implemented.
import gdbremote_testcase
import lldbgdbserverutils
import platform
+import signal
import unittest2
from lldbtest import *
@@ -736,7 +737,7 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
self.set_inferior_startup_attach()
self.Hg_switches_to_3_threads()
- def Hc_then_Csignal_signals_correct_thread(self):
+ def Hc_then_Csignal_signals_correct_thread(self, segfault_signo):
# NOTE only run this one in inferior-launched mode: we can't grab inferior stdout when running attached,
# and the test requires getting stdout from the exe.
@@ -778,7 +779,7 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
context = self.expect_gdbremote_sequence(timeout_seconds=10)
self.assertIsNotNone(context)
signo = context.get("signo")
- self.assertEqual(int(signo, 16), self.TARGET_EXC_BAD_ACCESS)
+ self.assertEqual(int(signo, 16), segfault_signo)
# Ensure we haven't seen this tid yet.
thread_id = int(context.get("thread_id"), 16)
@@ -845,7 +846,8 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
self.init_debugserver_test()
self.buildDsym()
self.set_inferior_startup_launch()
- self.Hc_then_Csignal_signals_correct_thread()
+ # Darwin debugserver translates some signals like SIGSEGV into some gdb expectations about fixed signal numbers.
+ self.Hc_then_Csignal_signals_correct_thread(self.TARGET_EXC_BAD_ACCESS)
@llgs_test
@dwarf_test
@@ -853,7 +855,7 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
self.init_llgs_test()
self.buildDwarf()
self.set_inferior_startup_launch()
- self.Hc_then_Csignal_signals_correct_thread()
+ self.Hc_then_Csignal_signals_correct_thread(signal.SIGSEGV)
def m_packet_reads_memory(self):
# This is the memory we will write into the inferior and then ensure we can read back with $m.
OpenPOWER on IntegriCloud