Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [patch/mips, rfc] Don't define FP_REGNUM
Date: Fri, 13 Sep 2002 15:16:00 -0000	[thread overview]
Message-ID: <20020913221651.GA22958@nevyn.them.org> (raw)
In-Reply-To: <3D824782.1040306@ges.redhat.com>

On Fri, Sep 13, 2002 at 04:16:02PM -0400, Andrew Cagney wrote:
> Hello,
> 
> Ok, so this takes things out of the theory stage :-)
> 
> The attached patch eliminates the totally bogus definition of FP_REGNUM 
> from the MIPS target.  It was being mapped to a pseudo register and that 
> pseudo register, through luck, not good management, sometimes contained 
> the contents of the SP.  It now always returns the SP.
> 
> To get this patch working, I needed to modify 
> ``legacy_virtual_frame_pointer'' (used by the tracepoint code) so that 
> it tries FP_REGNUM and then SP_REGNUM as a possible frame pointer 
> register.  As I write:
> 
> -  gdb_assert (FP_REGNUM >= 0);
> -  *frame_regnum = FP_REGNUM;
> +  /* FIXME: cagney/2002-09-13: This code is used when identifying the
> +     frame pointer of the current PC.  It is assuming that a single
> +     register and an offset can determine this.  Instead it should
> +     generate a byte code expression that computes the current FP.  */
> +  if (FP_REGNUM >= 0 && FP_REGNUM < NUM_REGS)
> +    *frame_regnum = FP_REGNUM;
> +  else if (SP_REGNUM >= 0 && SP_REGNUM < NUM_REGS)
> +    *frame_regnum = SP_REGNUM;
> +  else
> +    /* Should this be an internal error?  I guess so, it is reflecting
> +       an architectural limitation in the current design.  */
> +    internal_error (__FILE__, __LINE__, "No virtual frame pointer 
> available");
>    *frame_offset = 0;
> 
> For the MIPS to work, a custom virtual_frame_pointer() function would be 
> needed.  I don't see any point in implementing this, though, as there is 
> no tracepoint target to test it against.  Anyway, coments on this aspect 
> of the patch?    If not, I'll check it in.
> 
> [Hmm, need to mention this in the NEWS file.  The MIPS $fp will finally 
> behave as specified in the documentation.]

Looks good to me.  And there may someday be a tracepoint target to
test it against - I hope to add tracepoints to gdbserver, eventually.
When that happens I can revisit this.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2002-09-13 22:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-13 13:16 Andrew Cagney
2002-09-13 15:16 ` Daniel Jacobowitz [this message]
2002-09-17 14:20   ` Andrew Cagney
2002-09-17 16:27 ` 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=20020913221651.GA22958@nevyn.them.org \
    --to=drow@mvista.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