This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Add support for Morpho ms1 processor


> Date: Thu, 11 Aug 2005 16:53:33 -0700
> From: Kevin Buettner <kevinb@redhat.com>
>
> I'm reposting a revised version of the ms1-tdep.c portion of my earlier
> patch (since that's where all that's where all the problems were).
> 
> Thanks to Daniel and Mark for their earlier comments.  I believe I
> have addressed all of the earlier concerns.  (Except for adding an entry
> to MAINTAINERS - I'll address that separately).
> 
> Further comments?
>
> +  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.

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

Otherwise this looks great!

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]