Fixed TestInferiorCrashing failures
authorChaoren Lin <chaorenl@google.com>
Tue, 3 Feb 2015 01:51:05 +0000 (01:51 +0000)
committerChaoren Lin <chaorenl@google.com>
Tue, 3 Feb 2015 01:51:05 +0000 (01:51 +0000)
LLGS debugging is outputting different thread stop reasons than
local linux debugging.  The stop reasons are reasonable so I've left
left them alone.  Might update them to match darwin in the future.

llvm-svn: 227920

lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py

index 3050e54..ffd5382 100644 (file)
@@ -92,7 +92,7 @@ class CrashingInferiorTestCase(TestBase):
         if sys.platform.startswith("darwin"):
             stop_reason = 'stop reason = EXC_BAD_ACCESS'
         else:
-            stop_reason = 'stop reason = invalid address'
+            stop_reason = 'stop reason = signal SIGSEGV'
 
         # The stop reason of the thread should be a bad access exception.
         self.expect("thread list", STOPPED_DUE_TO_EXC_BAD_ACCESS,
@@ -101,6 +101,11 @@ class CrashingInferiorTestCase(TestBase):
 
         return stop_reason
 
+    def get_api_stop_reason(self):
+        if sys.platform.startswith("darwin"):
+            return lldb.eStopReasonException
+        return lldb.eStopReasonSignal
+
     def setUp(self):
         # Call super's setUp().
         TestBase.setUp(self)
@@ -136,7 +141,7 @@ class CrashingInferiorTestCase(TestBase):
                       "instead the actual state is: '%s'" %
                       lldbutil.state_type_to_str(process.GetState()))
 
-        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonException)
+        thread = lldbutil.get_stopped_thread(process, self.get_api_stop_reason())
         if not thread:
             self.fail("Fail to stop the thread upon bad access exception")