From: Daniel Jacobowitz <drow@false.org>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Add support for Morpho ms1 processor
Date: Sat, 04 Jun 2005 00:40:00 -0000 [thread overview]
Message-ID: <20050604004040.GA11023@nevyn.them.org> (raw)
In-Reply-To: <20050603172038.449a41b9@ironwood.lan>
On Fri, Jun 03, 2005 at 05:20:38PM -0700, Kevin Buettner wrote:
> The patch below adds support for the Morpho Technologies ms1 processor
> to GDB. This code was written by Michael Snyder. (Though I and
> perhaps others have tweaked it here and there...)
>
> It's not quite ready to commit; there are still some bits at the top
> level, and in bfd/, opcodes/, and include/ that need to go in first.
> Aldy Hernandez is submitting those portions.
>
> However, it occurs to me that there may be a few things in this GDB
> portion that ought to be adjusted before it goes in, so I'm posting it
> now for comments.
>
> So... comments?
This isn't exhaustive, I skipped over a lot of pieces.
> + E_LAST_REG, /* NOTE: must be LAST
> + (following all "real" regs). */
> +
> + E_NUM_REGS = E_LAST_REG, /* number of real registers */
Something named E_LAST_REG shouldn't have a number greater than that of
any register...
> + /* No function symbol, or no line symbol.
> + Use prologue scanning method. FIXME use dwarf2 cfi! */
Um, since this target DOES use dwarf2 cfi, you shouldn't be adding
fixmes about it.
In general you probably oughtn't add any FIXMEs in a new port.
> +static struct gdbarch *
> +ms1_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
> +{
> + struct gdbarch *gdbarch;
> + static void ms1_frame_unwind_init (struct gdbarch *);
I don't even see a reason for this to be a separate function. If there
is a reason, it certainly shouldn't have a block-local prototype.
> + /* The MAC register for the MS1-16-003 is 8 bits larger
> + than it is for the other machine variants. */
> + switch (info.bfd_arch_info->mach) {
> + default:
> + case bfd_mach_ms1:
> + break;
> + }
That doesn't do anything. I don't know if you're submitting half of a
port, or if it used to do something for this port... but it doesn't
now. And it's misformatted to boot :-)
> + /*
> + * Target builtin data types.
> + */
Ditto on formatting; lots of this one.
> + set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
> + set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
> + set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
> + set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
> + set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
> + set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
> + set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
> + set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
Ditto.
> +/* nota bene:
> +
> +trad_frame_alloc_saved_regs (struct frame_info *);
> +trad_frame_prev_register
> +
> +*/
Hmm....
Also a meta-note: this is the third, or maybe fourth, port that Red Hat
has submitted recently which has a lot of copy-paste bits. There is
common code to do some of these things, but when I ask people to use
it, I get complaints that the common code doesn't work right. Copying
the same version that you like better into every new port is _not_ a
winning maintenance technique.
In general if there is something in your tdep file that contains
nothing specific to your target, it's in the wrong place. I'm
talking about you, find_last_line_symbol.
And please go over the comment formatting.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-06-04 0:40 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 [this message]
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
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=20050604004040.GA11023@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@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