From 0e1d729b7541cb90c7e5d6107e96347abd120c39 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 20 Aug 2015 09:06:12 +0000 Subject: [NativeProcessLinux] Fix a bug in instruction-stepping over thread creation Summary: There was a bug in NativeProcessLinux, where doing an instruction-level single-step over the thread-creation syscall resulted in loss of control over the inferior. This happened because after the inferior entered the thread-creation maintenance stop, we unconditionally performed a PTRACE_CONT, even though the original intention was to do a PTRACE_SINGLESTEP. This is fixed by storing the original state of the thread before the stop (stepping or running) and then performing the appropriate action when resuming. I also get rid of the callback in the ThreadContext structure, which stored the lambda used to resume the thread, but which was not used consistently. A test verifying the correctness of the new behavior is included. Reviewers: ovyalov, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12104 llvm-svn: 245545 --- lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index 18f0e6b29721..87bb02e32b72 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -418,8 +418,6 @@ NativeThreadLinux::RequestStop () if (log) log->Printf ("NativeThreadLinux::%s tgkill(%" PRIu64 ", %" PRIu64 ", SIGSTOP) failed: %s", __FUNCTION__, pid, tid, err.AsCString ()); } - else - m_thread_context.stop_requested = true; return err; } -- cgit v1.2.3