[PATCH, rs6000] Add ppc64*_gnu_triplet_regexp methods.

will schmidt will_schmidt@vnet.ibm.com
Tue Aug 3 18:35:37 GMT 2021


On Thu, 2021-07-29 at 13:42 -0600, Tom Tromey wrote:
> > > > > > ">" == will schmidt via Gdb-patches <
> > > > > > gdb-patches@sourceware.org> writes:
> > > [PATCH, rs6000] Add ppc64*_gnu_triplet_regexp methods.
> > > Hi,
> > >   Add methods to set the target triplet so we can
> > > find the proper gcc when our gcc is named of
> > > the form powerpc64{le}-<foo>-gcc or ppc64{le}-<foo>-gcc.
> 
> Hi.  Thank you for the patch.
> I have a few nits, nothing too serious.
> 
> > > gdb/Changelog:
> > > yyyy-mm-dd  Will Schmidt  <will_schmidt@vnet.ibm.com>
> > > 	* gdb/ppc-linux-tdep.c (ppc64le_gnu_triplet_regexp): New
> > > 	function to set triplet.
> > > 	(ppc64_gnu_triplet_regexp): Same.
> > > 	(ppc_linux_init_abi): Conditionally call to set the
> > > 	ppc64 or ppc64le triplets.
> 
> ChangeLog entries aren't needed any more.

ok.  :-)
> 
> > > +static const char *
> > > +ppc64le_gnu_triplet_regexp (struct gdbarch *gdbarch)
> > > +{
> > > +        return "p(ower)*pc64le?";
> 
> Indentation looks off.

Ok.  I'm usually careful with whitespace, but I may have
hosed something up when pasting into the email.  I'll double-check.

> Also I would use "?" rather than "*" in this regexp.
> And, is the "e" really optional?  Seems a bit weird.

Correct, the 'e' is not optional.  My bad.  

Thanks for the review.  I'll refresh, retest, repost.

Thanks
-Will

> 
> > > +static const char *
> > > +ppc64_gnu_triplet_regexp (struct gdbarch *gdbarch)
> > > +{
> > > +        return "p(ower)*pc64?";
> 
> Same comments.
> 
> > > +     /* Set compiler triplet.  */
> > > +      if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
> > > +          set_gdbarch_gnu_triplet_regexp (gdbarch,
> > > ppc64le_gnu_triplet_regexp);
> > > +      else
> > > +          set_gdbarch_gnu_triplet_regexp (gdbarch,
> > > ppc64_gnu_triplet_regexp);
> 
> Indentation looks off here as well.
> 
> Tom



More information about the Gdb-patches mailing list