diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp index 97fff4b9f65a8..80b27571f43d5 100644 --- a/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp @@ -319,9 +319,12 @@ void NativeProcessFreeBSD::MonitorSIGTRAP(lldb::pid_t pid) { info.pl_siginfo.si_addr); if (thread) { + auto ®ctx = static_cast( + thread->GetRegisterContext()); auto thread_info = m_threads_stepping_with_breakpoint.find(thread->GetID()); - if (thread_info != m_threads_stepping_with_breakpoint.end()) { + if (thread_info != m_threads_stepping_with_breakpoint.end() && + threads_info->second == regctx.GetPC()) { thread->SetStoppedByTrace(); Status brkpt_error = RemoveBreakpoint(thread_info->second); if (brkpt_error.Fail()) diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 5c262db8db7fd..38b7092682873 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -829,8 +829,11 @@ void NativeProcessLinux::MonitorBreakpoint(NativeThreadLinux &thread) { thread.SetStoppedByBreakpoint(); FixupBreakpointPCAsNeeded(thread); - if (m_threads_stepping_with_breakpoint.find(thread.GetID()) != - m_threads_stepping_with_breakpoint.end()) + NativeRegisterContextLinux ®_ctx = thread.GetRegisterContext(); + auto stepping_with_bp_it = + m_threads_stepping_with_breakpoint.find(thread.GetID()); + if (stepping_with_bp_it != m_threads_stepping_with_breakpoint.end() && + stepping_with_bp_it->second == reg_ctx.GetPC()) thread.SetStoppedByTrace(); StopRunningThreads(thread.GetID());