From 42eb6908e035c0b8160591c680007936ec306400 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 26 Oct 2016 11:13:56 +0000 Subject: 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 llvm-svn: 285187 --- lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 2510d27dc3be..8e2587bce0e2 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1361,7 +1361,11 @@ Error NativeProcessLinux::SetupSoftwareSingleStepping( 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}); -- cgit v1.2.3