Author: labath
Date: Wed Oct 26 06:13:56 2016
New Revision: 285187

URL: http://llvm.org/viewvc/llvm-project?rev=285187&view=rev
Log:
Don't set a software stepping breakpoint at 0 on arm or mips.

Summary:
Check whether the setting the breakpoint failed during instruction emulation. If
it did, the next pc is likely in unmapped memory, and the inferior will crash
anyway after the next instruction. Do not return an error in this case, but just
continue stepping.
Reenabled the crash during step test for android/linux.

Reviewers: labath

Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines, lldb-commits

Differential Revision: https://reviews.llvm.org/D25926
Author: Jason Majors <jmaj...@google.com>

Modified:
    
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
    lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py?rev=285187&r1=285186&r2=285187&view=diff
==============================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
 Wed Oct 26 06:13:56 2016
@@ -21,11 +21,6 @@ class CreateDuringStepTestCase(TestBase)
         self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
 
     @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
-    @expectedFailureAndroid("llvm.org/pr24497", archs=['arm', 'aarch64'])
-    @expectedFailureAll(
-        oslist=["linux"],
-        archs=["arm"],
-        bugnumber="llvm.org/pr24497")
     # IO error due to breakpoint at invalid address
     @expectedFailureAll(triple=re.compile('^mips'))
     def test_step_inst_with(self):

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=285187&r1=285186&r2=285187&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Oct 26 
06:13:56 2016
@@ -1361,7 +1361,11 @@ Error NativeProcessLinux::SetupSoftwareS
     error = SetSoftwareBreakpoint(next_pc, 0);
   }
 
-  if (error.Fail())
+  // If setting the breakpoint fails because next_pc is out of
+  // the address space, ignore it and let the debugee segfault.
+  if (error.GetError() == EIO || error.GetError() == EFAULT) {
+    return Error();
+  } else if (error.Fail())
     return error;
 
   m_threads_stepping_with_breakpoint.insert({thread.GetID(), next_pc});


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to