public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [patch] gdbserver assert error on arm platform
@ 2023-05-11  6:20 zhiyong.yan
  2023-05-11 21:04 ` Kevin Buettner
  2023-06-19  1:50 ` Yan, Zhiyong
  0 siblings, 2 replies; 6+ messages in thread
From: zhiyong.yan @ 2023-05-11  6:20 UTC (permalink / raw)
  To: gdb-patches; +Cc: tom, zhiyong.yan

From: Zhiyong Yan <zhiyong.yan@windriver.com>

Bugzilla 30387 has given the steps of producing this issue on arm platform.
Gdb should not assume pending threads always generate “a non-gdbserver trap event”, a “Signal 17” event could happen.
Now that resume_stopped_resumed_lwps() -> may_hw_step() assumes that the break point must already exist, resume_one_thread() should ensure the software breaking point is installed although the thread is pending.

LINK: https://sourceware.org/bugzilla/show_bug.cgi?id=30387

Signed-off-by: Zhiyong Yan zhiyong.yan@windriver.com
---
 gdbserver/linux-low.cc | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index e6a39202a98..543daf66376 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -4670,8 +4670,16 @@ linux_process_target::resume_one_thread (thread_info *thread,
 
       proceed_one_lwp (thread, NULL);
     }
-  else
-    threads_debug_printf ("leaving LWP %ld stopped", lwpid_of (thread));
+  else{
+	threads_debug_printf ("leaving LWP %ld stopped", lwpid_of (thread));
+	if(thread->last_resume_kind == resume_step){
+	    /*
+	    * If resume_step is required by GDB, install single-step breakpoint.
+	    */
+	    if (supports_software_single_step())
+	       install_software_single_step_breakpoints (lwp);
+	}
+  }
 
   thread->last_status.set_ignore ();
   lwp->resume = NULL;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-22  1:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-11  6:20 [PATCH] [patch] gdbserver assert error on arm platform zhiyong.yan
2023-05-11 21:04 ` Kevin Buettner
2023-06-19  1:50 ` Yan, Zhiyong
2023-06-20  7:35   ` Bruno Larsen
2023-06-20  8:08     ` Yan, Zhiyong
2023-06-22  1:44       ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).