public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Lancelot SIX <lsix@lancelotsix.com>
To: will schmidt <will_schmidt@vnet.ibm.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	rogerio <rogealve@br.ibm.com>, Alan Modra <amodra@gmail.com>
Subject: Re: [PATCH, rs6000] Add ppc64*_gnu_triplet_regexp methods.
Date: Wed, 28 Jul 2021 22:04:32 +0000	[thread overview]
Message-ID: <20210728220304.xlsus4l3g76fo2rx@ubuntu.lan> (raw)
In-Reply-To: <d8a0c4bedfc30d488d6fbf4d4dd05cb1461ba93f.camel@vnet.ibm.com>

> +/* 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.

  reply	other threads:[~2021-07-28 22:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 15:36 will schmidt
2021-07-28 22:04 ` Lancelot SIX [this message]
2021-07-29 19:42 ` Tom Tromey
2021-08-03 18:35   ` will schmidt
2021-08-05 20:43   ` [PATCH, rs6000] [V2] " will schmidt
2021-08-16 12:14     ` Ulrich Weigand

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=20210728220304.xlsus4l3g76fo2rx@ubuntu.lan \
    --to=lsix@lancelotsix.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=amodra@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=rogealve@br.ibm.com \
    --cc=will_schmidt@vnet.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).