Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Cagney <ac131313@ges.redhat.com>,
	Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Rewrite mips_get_saved_register()
Date: Fri, 09 Aug 2002 13:59:00 -0000	[thread overview]
Message-ID: <1020809205925.ZM11149@localhost.localdomain> (raw)
In-Reply-To: Andrew Cagney <ac131313@ges.redhat.com> "Re: [RFA] Rewrite mips_get_saved_register()" (Aug  9, 12:12pm)

On Aug 9, 12:12pm, Andrew Cagney wrote:

> > This patch depends on the following (as of yet) unapproved patches:
> > 
> >     http://sources.redhat.com/ml/gdb-patches/2002-08/msg00189.html
> >     http://sources.redhat.com/ml/gdb-patches/2002-08/msg00195.html
> >     http://sources.redhat.com/ml/gdb-patches/2002-08/msg00196.html
> > 
> > Okay to commit?
> > 
> > 	* mips-tdep.c (mips_get_saved_register): Rewrite to use
> > 	frame_register_unwind() instead of find_saved_register().
> 
> Sorry, not like this.  Can you please, for the moment, just in-line the 
> call to find_saved_register().
> 
> (The two other bugs you fixed were definitly needed and thanks for 
> finding them.  How the code got away with not setting the SP I don't know.)
> 
> -      if (raw_buffer != NULL)
> - 
> {
> - 
>    LONGEST val;
> - 
>    if (regnum < 32)
> - 
>      /* Only MIPS_SAVED_REGSIZE bytes of GP registers are
> -               saved. */
> - 
>      val = read_memory_integer (addr, MIPS_SAVED_REGSIZE);
> - 
>    else
> - 
>      val = read_memory_integer (addr, REGISTER_RAW_SIZE (regnum));
> - 
>    store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), val);
> - 
> }
> 
> In theory (and emphasis on the theory) things need to be changed so that:
> 
> - 32 32 bit nameless pseudo-registers are added to the cooked register space
> - the 32 64 bit gprs get given a 64 bit virtual type so that they have 
> identical raw and virtual sizes
> - The debug info, for a 32 bit ABI, maps the gpr register numbers onto 
> the 32 bit pseudo register range
> - The gdbarch pseudo register read/write function maps the 32 bit 
> pseudo-registers onto the 64 bit gprs.
> - For init saved regs, dependant on the size of the register saved, 
> either the the address of the 64 bit GPR or the address of the 32 bit 
> pseudo-register is set
> - a custom mips register unwind function maps the requested register (64 
> bit gpr or 32 bit pseudo) onto: the 32 bit pseudo, the 64 bit gpr, or a 
> further recursive unwind call.  If it has to do a 32/64 mapping then it 
> sets not-an-lval.
> - you find you have to yank all sorts of register converible code
> 
> But like I said, it is theory, the mips suffers from one hack (like the 
> above) piled on top of another (the register convertable stuff, the 
> register raw/virtual size being different, ...).  I don't know if now is 
> the time to be experimenting with theories :-)

Yes, fixing all of the above is quite a lot more work than I have time
for at the moment.

But, assuming that my rewrite is functionally equivalent to the
original, what is the reason for preferring to inline
find_saved_register() over using the new interface?

I should think that using frame_register_unwind() would:

    - allow it to be better tested.  E.g, I wouldn't have found
      the bugs that I did recently had I not gone through this
      exercise.
    - shorten the time needed to reexamine mips_get_saved_register()
      when it finally does come time to reimplement or eliminate it.

Kevin


  reply	other threads:[~2002-08-09 20:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-08 17:37 Kevin Buettner
2002-08-09  9:13 ` Andrew Cagney
2002-08-09 13:59   ` Kevin Buettner [this message]
2002-08-09 20:26     ` Andrew Cagney

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=1020809205925.ZM11149@localhost.localdomain \
    --to=kevinb@redhat.com \
    --cc=ac131313@ges.redhat.com \
    --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