From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7866 invoked by alias); 25 Jan 2012 20:00:16 -0000 Received: (qmail 7844 invoked by uid 22791); 25 Jan 2012 20:00:12 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Jan 2012 19:59:58 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0PJxvme009738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Jan 2012 14:59:57 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0PJxuj8032337; Wed, 25 Jan 2012 14:59:57 -0500 Message-ID: <4F205F3C.7090406@redhat.com> Date: Wed, 25 Jan 2012 20:08:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: Jan Kratochvil Subject: Re: [patch 2/2] Fix watchpoints for multi-inferior #2 References: <20120102164652.GB10231@host2.jankratochvil.net> <4F02020F.5090906@gmail.com> <20120120213110.GB424@host2.jankratochvil.net> <4F1EAFE6.30202@redhat.com> <20120125152240.GA26914@host2.jankratochvil.net> <4F203B6A.7090605@redhat.com> <4F204408.4090607@redhat.com> In-Reply-To: <4F204408.4090607@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00875.txt.bz2 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 Jan Kratochvil * 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