From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108723 invoked by alias); 14 Aug 2018 11:37:13 -0000 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 Received: (qmail 108707 invoked by uid 89); 14 Aug 2018 11:37:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1620 X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Aug 2018 11:37:11 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01D95B5C6; Tue, 14 Aug 2018 11:37:10 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E6F01C5AA; Tue, 14 Aug 2018 11:37:08 +0000 (UTC) Subject: Re: [PATCHv2] gdb: Fix instability in thread groups test To: Andrew Burgess References: <20180810095750.13017-1-andrew.burgess@embecosm.com> <7da382e5-bd5e-25c2-b3f8-f38e692f35a1@redhat.com> <20180813114137.GX3155@embecosm.com> <2e47657d-b81b-497d-58bf-0463980dec24@redhat.com> <20180813130125.GY3155@embecosm.com> <7ab394a0-f796-4ff3-65e2-c7db9d7063e7@redhat.com> <20180813214531.GZ3155@embecosm.com> Cc: Simon Marchi , gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Tue, 14 Aug 2018 11:37:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180813214531.GZ3155@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-08/txt/msg00350.txt.bz2 On 08/13/2018 10:45 PM, Andrew Burgess wrote: > Here's an updated version of the patch based on previous feedback. > The new version has additional comments explaining why the regexp > allows an empty core list. I also only allow the empty core list > when we scan all processes, its only in this case we might hit an > exiting process. When we scan two known PIDs, I don't allow an empty > core list. Thanks. > +# The CORES_RE regexp allows a process to be running on zero or more > +# cores. This can happen if a process exits while GDB is reading > +# information out of /proc. > +set cores_re "cores=\\\[(\"$decimal\"(,\"$decimal\")*)?\\\]" LGTM, except "this" is slightly ambiguous here. Maybe: s/This can happen/The former can happen/ ? OK with that resolved. Thanks, Pedro Alves > > # List all available processes. > set process_entry_re "{${id_re},${type_re}(,$description_re)?(,$user_re)?(,$cores_re)?}" > @@ -64,6 +68,12 @@ set spawn_id_2 [remote_spawn target $binfile] > set pid_2 [spawn_id_get_pid $spawn_id_2] > set id_re_2 "id=\"$pid_2\"" > > +# Unlike the earlier CORES_RE this list must contain at least one > +# core. Given that we know these processes will not exit while GDB is > +# reading their information from /proc we can expect at least one core > +# for each process. > +set cores_re "cores=\\\[\"$decimal\"(,\"$decimal\")*\\\]" > + > set process_entry_re_1 "{${id_re_1},${type_re}(,$description_re)?(,$user_re)?(,$cores_re)?}" > set process_entry_re_2 "{${id_re_2},${type_re}(,$description_re)?(,$user_re)?(,$cores_re)?}" > >