[Lldb-commits] [lldb] r227920 - Fixed TestInferiorCrashing failures

Chaoren Lin chaorenl at google.com
Mon Feb 2 17:51:05 PST 2015


Author: chaoren
Date: Mon Feb  2 19:51:05 2015
New Revision: 227920

URL: http://llvm.org/viewvc/llvm-project?rev=227920&view=rev
Log:
Fixed TestInferiorCrashing failures

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.

Modified:
    lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py

Modified: lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py?rev=227920&r1=227919&r2=227920&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py (original)
+++ lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py Mon Feb  2 19:51:05 2015
@@ -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")
 





More information about the lldb-commits mailing list