Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [patch 2/2] Fix watchpoints for multi-inferior #2
Date: Wed, 25 Jan 2012 18:22:00 -0000	[thread overview]
Message-ID: <4F204408.4090607@redhat.com> (raw)
In-Reply-To: <4F203B6A.7090605@redhat.com>

On 01/25/2012 05:27 PM, Pedro Alves wrote:
> On 01/25/2012 03:22 PM, Jan Kratochvil wrote:
>> 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.
> 
> Yeah.  That cont_thread bit should really go away.
> 
> I've been looking at your other patch (the linux_wait_for_event_1 one), and
> seeing:
> 
> (gdb) run
> Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.multi/watchpoint-multi
> handling possible serial event
> getpkt ("QDisableRandomization:1");  [no ack sent]
> [address space randomization disabled]
> putpkt ("$OK#9a"); [noack mode]
> handling possible serial event
> getpkt ("vRun;2f686f6d652f706564726f2f6764622f6d796769742f6275696c642f6764622f7465737473756974652f6764622e6d756c74692f7761746368706f696e742d6d756c7469");  [no ack sent]
> new_argv[0] = "/home/pedro/gdb/mygit/build/gdb/testsuite/gdb.multi/watchpoint-multi"
> Process /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.multi/watchpoint-multi created; pid = 21270
> linux_wait: [Process 21270]
> pc is 0x40060f
> Need step over [LWP 21269]? yes, but found GDB breakpoint at 0x40060f; skipping step over
> Need step over [LWP 21270]? Ignoring, not stopped
> Resuming, no pending status or step over needed
> resuming LWP 21269
> pc is 0x40060f
> Resuming lwp 21269 (continue, signal 0, stop not expected)
>   resuming from pc 0x40060f
> resuming LWP 21270
> linux_wait_for_lwp: <all threads>
> 
> And I had a wth moment -- Why are we resuming 21269 at all, since
> we just spawned 21270.  I then realized that it is resumed exactly
> that by broken cont_thread code in linux_wait_1...
> 
> I really would like to get back to getting rid of those cont_thread
> bits, but, this patch, very similar to the one linked above (which fixed
> it for vAttach), completely fixes this testcase as well.

Bah, no, it is still not sufficient.  Don't know why it passed for me
before.  Looking again...

> The issue is that cont_thread is also stale from the previous run, when we
> start a new vRun.  So I think the patch below is correct, and should
> be applied.

-- 
Pedro Alves


  reply	other threads:[~2012-01-25 18:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-02 16:47 [patch 2/2] Fix watchpoints for multi-inferior Jan Kratochvil
2012-01-02 19:14 ` Pedro Alves
2012-01-20 21:34   ` [patch 2/2] Fix watchpoints for multi-inferior #2 Jan Kratochvil
2012-01-24 13:40     ` Pedro Alves
2012-01-24 14:20       ` [commit] " Jan Kratochvil
2012-01-25 15:57       ` Jan Kratochvil
2012-01-25 17:54         ` Pedro Alves
2012-01-25 18:22           ` Pedro Alves [this message]
2012-01-25 20:08             ` Pedro Alves
2012-01-26 21:56               ` [patch] protocol doc vs. gdbserver on H and pPID.-1 etc. [Re: [patch 2/2] Fix watchpoints for multi-inferior #2] Jan Kratochvil
2012-01-27 11:53                 ` Pedro Alves
2012-01-27 12:02                 ` Pedro Alves
2012-03-16 20:11               ` [patch 2/2] Fix watchpoints for multi-inferior #2 Pedro Alves
2012-03-16 20:14                 ` Jan Kratochvil

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=4F204408.4090607@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /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