jaydeep created this revision.
jaydeep added a reviewer: clayborg.
jaydeep added subscribers: bhushan, sagar, mohit.bhakkad, nitesh.jain, 
lldb-commits.
jaydeep set the repository for this revision to rL LLVM.

Single stepping requires setting software breakpoint at address 0x0. This 
results in input/output error instead of SIGSEGV. Using “continue” instead of 
single stepping avoids setting of software breakpoint at address 0x0.


Repository:
  rL LLVM

http://reviews.llvm.org/D15182

Files:
  
packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py

Index: 
packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
===================================================================
--- 
packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
+++ 
packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
@@ -43,9 +43,16 @@
         thread = process.GetThreadAtIndex(0)
         self.assertTrue(thread and thread.IsValid(), "Thread is valid")
 
-        # Keep stepping until the inferior crashes
-        while process.GetState() == lldb.eStateStopped and not 
lldbutil.is_thread_crashed(self, thread):
-            thread.StepInstruction(False)
+        # Single stepping requires setting software breakpoint at address 0x0. 
+        # This results in input/output error instead of SIGSEGV. Using 
"continue" 
+        # instead of single stepping avoids setting of software breakpoint at 
address 0x0.
+        arch = self.getArchitecture()
+        if re.match("mips", arch):
+            self.runCmd("continue")
+        else:
+            # Keep stepping until the inferior crashes
+            while process.GetState() == lldb.eStateStopped and not 
lldbutil.is_thread_crashed(self, thread):
+                thread.StepInstruction(False)
 
         self.assertEqual(process.GetState(), lldb.eStateStopped, 
PROCESS_STOPPED)
         self.assertTrue(lldbutil.is_thread_crashed(self, thread), "Thread has 
crashed")


Index: packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
===================================================================
--- packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
+++ packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
@@ -43,9 +43,16 @@
         thread = process.GetThreadAtIndex(0)
         self.assertTrue(thread and thread.IsValid(), "Thread is valid")
 
-        # Keep stepping until the inferior crashes
-        while process.GetState() == lldb.eStateStopped and not lldbutil.is_thread_crashed(self, thread):
-            thread.StepInstruction(False)
+        # Single stepping requires setting software breakpoint at address 0x0. 
+        # This results in input/output error instead of SIGSEGV. Using "continue" 
+        # instead of single stepping avoids setting of software breakpoint at address 0x0.
+        arch = self.getArchitecture()
+        if re.match("mips", arch):
+            self.runCmd("continue")
+        else:
+            # Keep stepping until the inferior crashes
+            while process.GetState() == lldb.eStateStopped and not lldbutil.is_thread_crashed(self, thread):
+                thread.StepInstruction(False)
 
         self.assertEqual(process.GetState(), lldb.eStateStopped, PROCESS_STOPPED)
         self.assertTrue(lldbutil.is_thread_crashed(self, thread), "Thread has crashed")
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to