From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] [gdbserver] assert on step if !can_hardware_single_step
Date: Tue, 07 Apr 2015 15:52:00 -0000 [thread overview]
Message-ID: <1428421925-18025-2-git-send-email-qiyaoltc@gmail.com> (raw)
In-Reply-To: <1428421925-18025-1-git-send-email-qiyaoltc@gmail.com>
From: Yao Qi <yao.qi@linaro.org>
GDB sends vCont;s by mistake to GDBserver on arm target which doesn't
have single step at all. However, it is hard to find the problem from
the debugging log. With this patch applied, the problem is easy to
identify, like:
(gdb) PASS: gdb.threads/non-stop-fair-events.exp: signal_thread=2: switch to thread 6 to step it
step&^M
(gdb) PASS: gdb.threads/non-stop-fair-events.exp: signal_thread=2: set 6 thread stepping
thread /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/linux-low.c:3686: A problem internal to GDBserver has been detected.^M
linux_resume_one_lwp_throw: Assertion `step == 0' failed.
gdb/gdbserver:
2015-04-02 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_resume_one_lwp_throw): Assert on step.
---
gdb/gdbserver/linux-low.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index e4c5420..bc6ab1ae 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -3682,6 +3682,9 @@ linux_resume_one_lwp_throw (struct lwp_info *lwp,
if (the_low_target.prepare_to_resume != NULL)
the_low_target.prepare_to_resume (lwp);
+ if (!can_hardware_single_step ())
+ gdb_assert (step == 0);
+
regcache_invalidate_thread (thread);
errno = 0;
lwp->stepping = step;
--
1.9.1
next prev parent reply other threads:[~2015-04-07 15:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-07 15:52 [PATCH 0/2] Honour software single step in fallback of displaced stepping Yao Qi
2015-04-07 15:52 ` Yao Qi [this message]
2015-04-07 17:09 ` [PATCH 1/2] [gdbserver] assert on step if !can_hardware_single_step Pedro Alves
2015-04-07 15:52 ` [PATCH 2/2] Honour software single step in fallback of displaced stepping Yao Qi
2015-04-07 16:59 ` [PATCH 0/2] " Pedro Alves
2015-04-08 9:51 ` Yao Qi
2015-04-16 12:00 ` Yao Qi
2015-04-16 12:02 ` Pedro Alves
2015-04-16 13:01 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428421925-18025-2-git-send-email-qiyaoltc@gmail.com \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox