Re: [patch 2/2] Fix watchpoints for multi-inferior #2

Jan Kratochvil
2012-01-25T15:23:03Z

On Tue, 24 Jan 2012 14:19:34 +0100, Pedro Alves wrote:
> On 01/20/2012 09:31 PM, Jan Kratochvil wrote:
> > @@ -2107,7 +2090,14 @@ retry:
> > if (thread == NULL)
> > {
> > struct thread_resume resume_info;
> > - resume_info.thread = minus_one_ptid;
> > +
> > + /* Resume only a single process if requested so. */
> > + if (!ptid_equal (cont_thread, minus_one_ptid)
> > + && ptid_get_lwp (cont_thread) == -1)
> > + resume_info.thread = cont_thread;
>
> Just above we see:
>
> thread = (struct thread_info *) find_inferior_id (&all_threads,
> cont_thread);
>
> /* No stepping, no signal - unless one is pending already, of course. */
> if (thread == NULL)
>
> So, cont_thread does not exist, which was the whole point of reaching
> here. Therefore there's no use trying to resuming it (at first sight).
>
> BTW, I have just recently stumbled on this:
>
> http://sourceware.org/ml/gdb-patches/2012-01/msg00502.html
>
> But as said, I'll need to take a better look at the gdbserver bits.

FYI I did not repost this patch part as it needs to be implemented by some
larger code rewrite IMO now, anyway this patch chunk is not good according to
your review.

Thanks,
Jan