[Lldb-commits] [PATCH] D25792: Don't set a software stepping breakpoint at 0 on arm.
jmajors created this revision. jmajors added a reviewer: labath. jmajors added a subscriber: lldb-commits. Herald added subscribers: srhines, danalbert, tberghammer, rengolin, aemerson. Added a test for the next_pc being zero before setting a software breakpoint in arm32. Reenabled the crash during step test for android/linux. https://reviews.llvm.org/D25792 Files: .gitignore packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py source/Plugins/Process/Linux/NativeProcessLinux.cpp Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1347,7 +1347,7 @@ if (next_flags & 0x20) { // Thumb mode error = SetSoftwareBreakpoint(next_pc, 2); -} else { +} else if (next_pc) { // Arm mode error = SetSoftwareBreakpoint(next_pc, 4); } 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 @@ -21,11 +21,6 @@ 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): Index: .gitignore === --- .gitignore +++ .gitignore @@ -21,7 +21,7 @@ *.sln *.suo # vim swap files -.*.swp +.*.sw? .sw? # OS X specific files. .DS_store @@ -39,7 +39,12 @@ __pycache__/ *.lock *.so +a.out +*.o +*.d +*.dwo +.ycm_extra_conf.py clang-module-cache # Skip ctags-style tags files Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1347,7 +1347,7 @@ if (next_flags & 0x20) { // Thumb mode error = SetSoftwareBreakpoint(next_pc, 2); -} else { +} else if (next_pc) { // Arm mode error = SetSoftwareBreakpoint(next_pc, 4); } 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 @@ -21,11 +21,6 @@ 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): Index: .gitignore === --- .gitignore +++ .gitignore @@ -21,7 +21,7 @@ *.sln *.suo # vim swap files -.*.swp +.*.sw? .sw? # OS X specific files. .DS_store @@ -39,7 +39,12 @@ __pycache__/ *.lock *.so +a.out +*.o +*.d +*.dwo +.ycm_extra_conf.py clang-module-cache # Skip ctags-style tags files ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25926: Don't set a software stepping breakpoint at 0 on arm or mips.
jmajors created this revision. jmajors added a reviewer: labath. jmajors added a subscriber: lldb-commits. Herald added subscribers: srhines, danalbert, tberghammer, rengolin, aemerson. Added a test for the next_pc being zero before setting a software breakpoint in arm32 and mips. Reenabled the crash during step test for android/linux. https://reviews.llvm.org/D25926 Files: packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py source/Plugins/Process/Linux/NativeProcessLinux.cpp Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1351,12 +1351,23 @@ // Arm mode error = SetSoftwareBreakpoint(next_pc, 4); } + +// 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) { + error.Clear(); +} } else if (m_arch.GetMachine() == llvm::Triple::mips64 || m_arch.GetMachine() == llvm::Triple::mips64el || m_arch.GetMachine() == llvm::Triple::mips || - m_arch.GetMachine() == llvm::Triple::mipsel) + m_arch.GetMachine() == llvm::Triple::mipsel) { error = SetSoftwareBreakpoint(next_pc, 4); - else { +// 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) { + error.Clear(); +} + } else { // No size hint is given for the next breakpoint error = SetSoftwareBreakpoint(next_pc, 0); } 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 @@ -21,11 +21,6 @@ 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): Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1351,12 +1351,23 @@ // Arm mode error = SetSoftwareBreakpoint(next_pc, 4); } + +// 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) { + error.Clear(); +} } else if (m_arch.GetMachine() == llvm::Triple::mips64 || m_arch.GetMachine() == llvm::Triple::mips64el || m_arch.GetMachine() == llvm::Triple::mips || - m_arch.GetMachine() == llvm::Triple::mipsel) + m_arch.GetMachine() == llvm::Triple::mipsel) { error = SetSoftwareBreakpoint(next_pc, 4); - else { +// 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) { + error.Clear(); +} + } else { // No size hint is given for the next breakpoint error = SetSoftwareBreakpoint(next_pc, 0); } 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 @@ -21,11 +21,6 @@ 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): ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-com
[Lldb-commits] [PATCH] D25926: Don't set a software stepping breakpoint at 0 on arm or mips.
jmajors updated this revision to Diff 75779. jmajors added a comment. Restructured the code to skip setting a software breakpoint at 0. https://reviews.llvm.org/D25926 Files: packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py source/Plugins/Process/Linux/NativeProcessLinux.cpp Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1361,7 +1361,11 @@ 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}); 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 @@ -21,11 +21,6 @@ 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): Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp === --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1361,7 +1361,11 @@ 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}); 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 @@ -21,11 +21,6 @@ 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): ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits