Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Add support for Morpho ms1 processor
Date: Fri, 12 Aug 2005 20:52:00 -0000	[thread overview]
Message-ID: <20050812134946.62ecd892@ironwood.lan> (raw)
In-Reply-To: <200508121035.j7CAZs6D029649@elgar.sibelius.xs4all.nl>

On Fri, 12 Aug 2005 12:35:54 +0200 (CEST)
Mark Kettenis <mark.kettenis@xs4all.nl> wrote:

> > +  if (regnum >= 0 &&
> > +      regnum < sizeof (register_names) / sizeof (register_names[0]))
> > +    {
> > +      return register_names[regnum];
> > +    }
> > +  else
> > +    internal_error (__FILE__, __LINE__,
> > +		    _("ms1_register_name: illegal register number %d"), regnum);
> > +}
> 
> Please consider usin ARRAY_SIZE.  I'd also use gdb_assert() here
> instead of the excplicit internal_error(), but that's a bit of a
> personal preference I assume.  Please use invalid instead of illegal.

I'm okay with gdb_assert().  That allows us to condense the above bit of
code to just:

  gdb_assert (regnum >= 0 && regnum < ARRAY_SIZE (register_names));
  return register_names[regnum];

The other benefit to using gdb_assert() is that there's one less string
for the i18n translators to worry about.

> > +static const unsigned char *
> > +ms1_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
> > +{
> > +  static char breakpoint[] = { 0x68, 0, 0, 0 };
> > +
> > +  *bp_size = 4;
> > +  return breakpoint;
> > +}
> 
> Please use gdb_byte here too.

Done.  (I've changed the return type of ms1_breakpoint_from_pc() and
the declaration of breakpoint[] in my sources.)

> Otherwise this looks great!

Thank you for reviewing this patch.

Kevin


  reply	other threads:[~2005-08-12 20:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-04  0:21 Kevin Buettner
2005-06-04  0:40 ` Daniel Jacobowitz
2005-06-10 23:13 ` Mark Kettenis
2005-06-11  1:40   ` Michael Snyder
2005-06-11  1:57   ` Daniel Jacobowitz
2005-08-12  0:04     ` Kevin Buettner
2005-08-15 22:33       ` Kevin Buettner
2005-08-11 23:58 ` Kevin Buettner
2005-08-12  9:43   ` Eli Zaretskii
2005-08-15 22:27     ` Kevin Buettner
2005-08-16 17:23       ` Eli Zaretskii
2005-08-17 23:13         ` Kevin Buettner
2005-08-12 11:51   ` Mark Kettenis
2005-08-12 20:52     ` Kevin Buettner [this message]
2005-08-12 20:57       ` Mark Kettenis
2005-08-15 22:03 ` Kevin Buettner

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=20050812134946.62ecd892@ironwood.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sources.redhat.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