From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 51AB8385C405 for ; Wed, 28 Jul 2021 22:04:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 51AB8385C405 Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 4CD6181882; Wed, 28 Jul 2021 22:04:36 +0000 (UTC) Date: Wed, 28 Jul 2021 22:04:32 +0000 From: Lancelot SIX To: will schmidt Cc: "gdb-patches@sourceware.org" , Ulrich Weigand , rogerio , Alan Modra Subject: Re: [PATCH, rs6000] Add ppc64*_gnu_triplet_regexp methods. Message-ID: <20210728220304.xlsus4l3g76fo2rx@ubuntu.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Wed, 28 Jul 2021 22:04:36 +0000 (UTC) X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2021 22:04:39 -0000 > +/* Specify the powerpc64le target triplet. > + This can be variations of > + ppc64le-{distro}-linux-gcc > + and > + powerpc64le-{distro}-linux-gcc > + */ > +static const char * > +ppc64le_gnu_triplet_regexp (struct gdbarch *gdbarch) > +{ > + return "p(ower)*pc64le?"; > +} > + > +/* Specify the powerpc64 target triplet. > + This can be variations of > + ppc64-{distro}-linux-gcc > + and > + powerpc64-{distro}-linux-gcc > + */ > +static const char * > +ppc64_gnu_triplet_regexp (struct gdbarch *gdbarch) > +{ > + return "p(ower)*pc64?"; > +} > + Hi, It looks like that the first '*' in both of your regex says that 'ower' can be matched any number of time. With this, something like 'powerowerpc64' will match. You should replace them with '?' (which stands for “match 0 or 1 time”). Also, the last '?' of your says that the last char is optional, and should probably be removed. With that given into account, I think your patterns should look something like: - "p(ower)?pc64le" - "p(ower)?pc64" I think that a '-' is appended right after this so there should not be an issue with the second pattern matching for 'ppc64le'. If there is an issue here, it should be possible to append '(?!l)' (which means “not followed by a 'l'”), but I am not sure if this is supported by the regex library used by GDB. (I have not tested those, but they should work with pretty much any regex library). Best, Lancelot.