This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH 2/2] Fix gdb.threads/multiple-step-overs.exp fails on arm
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 17 Nov 2015 12:33:13 +0000
- Subject: Re: [PATCH 2/2] Fix gdb.threads/multiple-step-overs.exp fails on arm
- Authentication-results: sourceware.org; auth=none
- References: <1446130862-12824-1-git-send-email-yao dot qi at linaro dot org> <1446130862-12824-3-git-send-email-yao dot qi at linaro dot org> <563A3E3F dot 9060204 at redhat dot com> <86d1vjxvp5 dot fsf at gmail dot com>
On 11/09/2015 11:23 AM, Yao Qi wrote:
> Pedro Alves <email@example.com> writes:
> Hi Pedro,
>>> GDB resumes the whole process (all threads) rather than the specific
>>> thread it wants to single step (as shown in ). That is wrong.
>> (I understand this, but I think it'd make it clearer to explicitly
>> state _why_ that is wrong.)
> I am not sure how to make the description clearer, how about this?
> GDB resumes the whole process (all threads) rather than the specific
> thread for which GDB wants to step over the breakpoint (as shown in ).
> That is wrong.
I think the _why_ is that wrong is still missing. I was thinking
of something around this:
The reason we resume a single thread and leave others stopped when doing a
normal step over where we temporarily remove the breakpoint, single-step,
reinsert the breakpoint, is that if we let other threads run in the period
while the breakpoint is removed, then these other threads could miss
the breakpoint. Since with displaced stepping, we don't ever remove the
breakpoint, it should be fine to let other threads run. However, there's another
reason that we should not let other threads run: that is the case where some of
those threads are also stopped for a breakpoint that itself needs to be
stepped over. If we just let those threads run, then they immediately re-trap
their breakpoint again.
> Patch below is regression tested on x86_64-linux and arm-linux.