Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Resurrect v850
Date: Tue, 17 May 2005 13:52:00 -0000	[thread overview]
Message-ID: <20050517133137.GA3543@nevyn.them.org> (raw)
In-Reply-To: <20050517132348.GF18174@calimero.vinschen.de>

On Tue, May 17, 2005 at 03:23:48PM +0200, Corinna Vinschen wrote:
> Hi Daniel,
> 
> On May 15 13:44, Daniel Jacobowitz wrote:
> > On Fri, May 13, 2005 at 01:40:16PM +0200, Corinna Vinschen wrote:
> > > Hi,
> > > 
> > > the below patch resurrects v850.  No deprecated mechanisms are used.
> > > As promised, this target now uses trad_frames ;-)
> > > 
> > > Ok to apply?
> > 
> > Some comments...
> 
> While reworking the code according to your comments, I came across three
> problems:
> 
> > > +enum {
> > > + E_R0_REGNUM,
> > > + E_R1_REGNUM,
> > > + E_R2_REGNUM, E_SAVE1_START_REGNUM = E_R2_REGNUM, E_SAVE1_END_REGNUM = E_R2_REGNUM,
> > > + E_R3_REGNUM, E_SP_REGNUM = E_R3_REGNUM,
> > 
> > Several of the lines in this list are too long.  I do see how you were
> > trying to organize it, but if you put one to a line the lines with
> > equality operators will still stand out.
> 
> Is a layout like this:
> 
>   E_R1_REGNUM,
>   E_R2_REGNUM, E_SAVE1_START_REGNUM = E_R2_REGNUM,
>                E_SAVE1_END_REGNUM = E_R2_REGNUM,
>   E_R3_REGNUM, E_SP_REGNUM = E_R3_REGNUM,
>   [...]
> 
> ok?

I was originally going to suggest that - but no, it isn't. 
gdb_indent.sh will promptly undo this the next time someone needs to
correct indentation in the file.  That's the problem with
machine-enforced standards...

> 
> > The comments in this function are seriously un-encouraging.  Is this
> > excess space necessary or not?  If it is, why?
> 
> I don't know.  The ABI is defined this way and inspecting a lot of code
> I didn't see any reason for this behaviour.  Nevertheless, gcc emits
> code which allocates these 16 byte for no apparent reason.  I removed
> useless comments and the remaining comment now read like this:
> 
>   /* The offset onto the stack at which we will start copying parameters
>      (after the registers are used up) begins at 16 rather than at zero.
>      That's how the ABI is defined, though there's no indication that these
>      16 bytes are used for anything, not even for saving incoming
>      argument registers.  */
> 
> Is that ok?

Yes, definitely.


> 
> > > +static void
> > > +v850_frame_prev_register (struct frame_info *next_frame, void **this_cache,
> > > +			  int regnum, int *optimizedp,
> > > +			  enum lval_type *lvalp, CORE_ADDR *addrp,
> > > +			  int *realnump, void *valuep)
> > > +{
> > > +  struct v850_frame_cache *cache = v850_frame_cache (next_frame, this_cache);
> > > +
> > > +  gdb_assert (regnum >= 0);
> > > +
> > > +  /* The PC of the previous frame is stored in the PR register of
> > > +     the current frame.  Frob regnum so that we pull the value from
> > > +     the correct place.  */
> > > +  if (regnum == E_PC_REGNUM)
> > > +    regnum = E_LP_REGNUM;
> > > +
> > > +  trad_frame_get_prev_register (next_frame, cache->saved_regs, regnum,
> > > +				optimizedp, lvalp, addrp, realnump, valuep);
> > > +}
> > 
> > You can do the frobbing when you record the saved registers - at the
> > end, copy the saved location.
> 
> Sorry, I don't understand this.  Can you show me some (pseudo) code what
> you mean?

I believe that you can do "cache->saved_regs[E_PC_REGNUM] =
cache->saved_regs[E_LP_REGNUM]", right by the call to
trad_frame_addr_p.  Does that work?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


  reply	other threads:[~2005-05-17 13:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-13 12:28 Corinna Vinschen
2005-05-15 18:20 ` Daniel Jacobowitz
2005-05-17 13:39   ` Corinna Vinschen
2005-05-17 13:52     ` Daniel Jacobowitz [this message]
2005-05-17 14:39       ` Corinna Vinschen
2005-05-17 20:40         ` Mark Kettenis
2005-05-18  1:11           ` Daniel Jacobowitz
2005-05-18  1:25             ` Mark Kettenis
2005-05-18  1:40         ` Daniel Jacobowitz
2005-05-18 10:18           ` Corinna Vinschen
2005-05-17 14:01     ` Corinna Vinschen
2005-05-17 14:10       ` Daniel Jacobowitz

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=20050517133137.GA3543@nevyn.them.org \
    --to=drow@false.org \
    --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