Author: emaste Date: Fri May 29 14:38:41 2015 New Revision: 238600 URL: http://llvm.org/viewvc/llvm-project?rev=238600&view=rev Log: TestHandleSegv: also assert that we have a thread
If get_stopped_thread(... eStopReasonSignal) returns no thread, the thread.IsValid assertion would throw AttributeError: 'NoneType' object has no attribute 'IsValid'. Differential Revision: http://reviews.llvm.org/D10123 Modified: lldb/trunk/test/functionalities/signal/handle-segv/TestHandleSegv.py Modified: lldb/trunk/test/functionalities/signal/handle-segv/TestHandleSegv.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/signal/handle-segv/TestHandleSegv.py?rev=238600&r1=238599&r2=238600&view=diff ============================================================================== --- lldb/trunk/test/functionalities/signal/handle-segv/TestHandleSegv.py (original) +++ lldb/trunk/test/functionalities/signal/handle-segv/TestHandleSegv.py Fri May 29 14:38:41 2015 @@ -29,7 +29,7 @@ class HandleSegvTestCase(TestBase): signo = process.GetUnixSignals().GetSignalNumberFromName("SIGSEGV") thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonSignal) - self.assertTrue(thread.IsValid(), "Thread should be stopped due to a signal") + self.assertTrue(thread and thread.IsValid(), "Thread should be stopped due to a signal") self.assertTrue(thread.GetStopReasonDataCount() >= 1, "There was data in the event.") self.assertEqual(thread.GetStopReasonDataAtIndex(0), signo, "The stop signal was SIGSEGV") _______________________________________________ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits