Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFC] Add support for Renesas RX architecture
Date: Mon, 07 Dec 2009 20:39:00 -0000	[thread overview]
Message-ID: <20091207133912.3e97099d@redhat.com> (raw)
In-Reply-To: <20091204173837.GD2891@adacore.com>

On Fri, 4 Dec 2009 09:38:37 -0800
Joel Brobecker <brobecker@adacore.com> wrote:

> > I'll note up front that there's one #if 0 in rx-tdep.c.  I'd prefer to
> > leave it there until Nick and I get all of the kinks worked out of
> > the debug info.  I'm willing to remove it though if there are objections
> > to having it in new code.
> 
> I usually prefer to avoid #if 0 code, but the comment is definitely
> useful.  In this particular case, I don't think it's so bad, although,
> IMO, the same effect could have been achieved without the #if 0, just
> the comment (enabling the dwarf2 unwinders is standard, so it's not
> like we need the reminder). Anyway, I'm personally OK, since I presume
> that this in the TODO list to get fixed as some point in the near/medium
> future.

In my recent testing, I've been flipping back and forth between #if 0
and #if 1 as I test the code.  And, you're right, it is our plan to
get this fixed in short order.

> > Comments?
> > 
> > 	* configure.tgt: Add rx-*-elf target.
> > 	* rx-tdep.c: New target.
> 
> Yes. Great code, very clean.  Please go ahead and commit. I think this
> also deserves a NEWS entry (you can send it as a separate patch for Eli).

As I mentioned in my commit message, thanks for the review!  I've just
posted a patch for NEWS.

> Nice to see someone using the prologue-value infrastructure too, btw.

It's a very nice bit of infrastructure, making it much easier to write
prologue analyzers, IMO.

The other cool thing about the prologue analyzer for this architecture
is that it shares its instruction decoder with the simulator and various
utilities in binutils.  The decoder returns symbolic values for the
instruction and operand types, making the code a lot cleaner than the
usual mask against a hex value with a comparison to another hex value.
Here's a brief example from rx-tdep.c:

      else if (opc.id == RXO_mov	/* mov.l rsrc, [-SP] */
	       && opc.op[0].type == RX_Operand_Predec
	       && opc.op[0].reg == RX_SP_REGNUM
	       && opc.op[1].type == RX_Operand_Register
	       && opc.size == RX_Long)

It reads well enough that I could have almost dispensed with the
comment - in fact, as I look over the code, it appears that in some
cases, I did dispense with the comment.  The one gotcha which might
make it worth keeping the comments, and would perhaps make it worth it
for me to go back and add the missing ones, is that in some cases, the
operand order specified by opc.op[N] is not always the same as that
implied by the syntax.  However, even with this gotcha, this approach
is still preferable to the alternative of shifting and masking a portion
of the raw instruction stream to determine the operand.

Kevin


  reply	other threads:[~2009-12-07 20:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-03 23:19 Kevin Buettner
2009-12-04 17:38 ` Joel Brobecker
2009-12-07 20:39   ` Kevin Buettner [this message]
2009-12-07 20:56     ` Daniel Jacobowitz
2009-12-07 21:21       ` DJ Delorie
2009-12-07 21:29         ` Daniel Jacobowitz
2009-12-07 21:42           ` DJ Delorie
2009-12-07 22:36             ` Doug Evans
2009-12-07 23:20               ` DJ Delorie
2009-12-08  2:01                 ` Doug Evans
2009-12-07 22:10       ` Michael Snyder
2009-12-07 22:38         ` Doug Evans
2009-12-07 20:00 ` 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=20091207133912.3e97099d@redhat.com \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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