From 0948f1cf8177e378bdea2239b8c3ffb9db31f9ad Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Wed, 27 Jul 2022 09:27:51 -0700 Subject: Reapply the commits to enable accurate hit-count detection for watchpoints. This commit combines the initial commit (7c240de609af), a fix for x86_64 Linux (3a0581501e76) and a fix for thinko in a last minute rewrite that I really should have run the testsuite on. Also, make sure that all the "I need to step over watchpoint" plans execute before we call a public stop. Otherwise, e.g. if you have N watchpoints and a Signal, the signal stop info will get us to stop with the watchpoints in a half-done state. Differential Revision: https://reviews.llvm.org/D130674 --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index e3dada1..233a665f6 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1675,7 +1675,15 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo( if (dispatch_queue_t != LLDB_INVALID_ADDRESS) gdb_thread->SetQueueLibdispatchQueueAddress(dispatch_queue_t); - // Make sure we update our thread stop reason just once + // Make sure we update our thread stop reason just once, but don't + // overwrite the stop info for threads that haven't moved: + StopInfoSP current_stop_info_sp = thread_sp->GetPrivateStopInfo(false); + if (thread_sp->GetTemporaryResumeState() == eStateSuspended && + current_stop_info_sp) { + thread_sp->SetStopInfo(current_stop_info_sp); + return thread_sp; + } + if (!thread_sp->StopInfoIsUpToDate()) { thread_sp->SetStopInfo(StopInfoSP()); // If there's a memory thread backed by this thread, we need to use it -- cgit v1.1