This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Add support for Morpho ms1 processor
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: kevinb at redhat dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 12 Aug 2005 12:35:54 +0200 (CEST)
- Subject: Re: [RFC] Add support for Morpho ms1 processor
- References: <20050603172038.449a41b9@ironwood.lan> <20050811165333.7d9d02f8@ironwood.lan>
> 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