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 20:08:00 -0000	[thread overview]
Message-ID: <4F205F3C.7090406@redhat.com> (raw)
In-Reply-To: <4F204408.4090607@redhat.com>

On 01/25/2012 06:03 PM, Pedro Alves wrote:
> On 01/25/2012 05:27 PM, Pedro Alves wrote:
>> On 01/25/2012 03:22 PM, Jan Kratochvil wrote:

>> 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.

This one is sufficient.  The hints were all in your patch already, but
I guess I'm slow today.

Makes no sense setting the cont_thread to a process wildcard, there's no
such thing in the protocol.  So this brings in a variant of your patch,
that fixes it early on, instead of late in the target, along with clearing
cont_thread on vRun.

gdb/gdbserver/
2012-01-25  Pedro Alves  <palves@redhat.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>

	* server.c (start_inferior): Clear `cont_thread'.
	(handle_v_cont): Don't set `cont_thread' if resuming all threads
	of a process.
---

 gdb/gdbserver/server.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index c1788a9..aedf6f5 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -259,6 +259,10 @@ start_inferior (char **argv)
   signal (SIGTTIN, SIG_DFL);
 #endif

+  /* Clear this so the backend doesn't get confused, thinking
+     CONT_THREAD died, and it needs to resume all threads.  */
+  cont_thread = null_ptid;
+
   signal_pid = create_inferior (new_argv[0], new_argv);

   /* FIXME: we don't actually know at this point that the create
@@ -1902,7 +1906,8 @@ handle_v_cont (char *own_buf)

   /* Still used in occasional places in the backend.  */
   if (n == 1
-      && !ptid_equal (resume_info[0].thread, minus_one_ptid)
+      && !(ptid_equal (resume_info[0].thread, minus_one_ptid)
+	   || ptid_get_lwp (resume_info[0].thread) == -1)
       && resume_info[0].kind != resume_stop)
     cont_thread = resume_info[0].thread;
   else


  reply	other threads:[~2012-01-25 20:00 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
2012-01-25 20:08             ` Pedro Alves [this message]
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=4F205F3C.7090406@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