This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] [GDBserver] step over shouldn't be ongoing in proceed_one_lwp
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 29 Apr 2016 09:08:21 +0100
- Subject: [PATCH] [GDBserver] step over shouldn't be ongoing in proceed_one_lwp
- Authentication-results: sourceware.org; auth=none
Hi,
proceed_one_lwp is called by either unstop_all_lwps or proceed_all_lwps,
and the step over shouldn't be ongoing, either not started or finished,
so the "else if (lwp->bp_reinsert != 0)" looks like a dead code. This
patch is to remove it, add an assert that "lwp->bp_reinsert == 0", and
remove some comments in proceed_one_lwp.
Regression tested on x86_64-linux and arm-linux.
gdb/gdbserver:
2016-04-29 Yao Qi <yao.qi@linaro.org>
* linux-low.c (proceed_one_lwp): Remove comments. Assert on
"lwp->bp_reinsert == 0". Remove code if (lwp->bp_reinsert != 0).
---
gdb/gdbserver/linux-low.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 8e1e2fc..2737d27 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -4943,11 +4943,7 @@ linux_resume (struct thread_resume *resume_info, size_t n)
/* This function is called once per thread. We check the thread's
last resume request, which will tell us whether to resume, step, or
leave the thread stopped. Any signal the client requested to be
- delivered has already been enqueued at this point.
-
- If any thread that GDB wants running is stopped at an internal
- breakpoint that needs stepping over, we start a step-over operation
- on that particular thread, and leave all others stopped. */
+ delivered has already been enqueued at this point. */
static int
proceed_one_lwp (struct inferior_list_entry *entry, void *except)
@@ -5017,6 +5013,9 @@ proceed_one_lwp (struct inferior_list_entry *entry, void *except)
send_sigstop (lwp);
}
+ /* All step-overs shouldn't be ongoing when proceeding lwps. */
+ gdb_assert (lwp->bp_reinsert == 0);
+
if (thread->last_resume_kind == resume_step)
{
if (debug_threads)
@@ -5024,13 +5023,6 @@ proceed_one_lwp (struct inferior_list_entry *entry, void *except)
lwpid_of (thread));
step = 1;
}
- else if (lwp->bp_reinsert != 0)
- {
- if (debug_threads)
- debug_printf (" stepping LWP %ld, reinsert set\n",
- lwpid_of (thread));
- step = 1;
- }
else
step = 0;
--
1.9.1