This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Fix gdb.threads/multiple-step-overs.exp fails on arm


On 11/09/2015 11:23 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
> 
> Hi Pedro,
> 
>>> GDB resumes the whole process (all threads) rather than the specific
>>> thread it wants to single step (as shown in [1]).  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 [1]).
> 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.
> 

LGTM.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]