Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Nomura <nomura@netapp.com>
To: gdb-patches@sources.redhat.com
Subject: inconsistent sigtramp code in mips target
Date: Tue, 28 Oct 2003 21:58:00 -0000	[thread overview]
Message-ID: <20031028215814.GY4320@bughouse.netapp.com> (raw)

gdb 6.0, file gdb/mips-tdep.c, function mips_find_saved_regs:

There are calls to "set_reg_offset" in a loop, followed by
some individual calls after the loop.  The latter have
no effect if the register was processed in the loop
(see the code for set_reg_offset).  SP_REGNUM is like this,
but PC_REGNUM is not, because of the particular values of
these constants (ugh).


  if ((get_frame_type (fci) == SIGTRAMP_FRAME))
    {
      for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
        {
          CORE_ADDR reg_position = (get_frame_base (fci) + SIGFRAME_REGSAVE_OFF
                                    + ireg * SIGFRAME_REG_SIZE);
          set_reg_offset (saved_regs, ireg, reg_position);
        }
      for (ireg = 0; ireg < MIPS_NUMREGS; ireg++)
        {
          CORE_ADDR reg_position = (get_frame_base (fci)
                                    + SIGFRAME_FPREGSAVE_OFF
                                    + ireg * SIGFRAME_REG_SIZE);
          set_reg_offset (saved_regs, FP0_REGNUM + ireg, reg_position);
        }

      set_reg_offset (saved_regs, PC_REGNUM, get_frame_base (fci) + SIGFRAME_PC_OFF);
      /* SP_REGNUM, contains the value and not the address.  */
      set_reg_offset (saved_regs, SP_REGNUM, get_frame_base (fci));
      return;
    }


The logical patch would be to move the special cases up front,
but I have no way to test this out (no access to a MIPS UNIX
platform).

On the other hand this isn't purely academic.  I came across this
because I need to define a custom sigtramp frame for our own
MIPS embedded platform.  It was baffling for a while that my
modification to the SP_REGNUM override had no effect.


             reply	other threads:[~2003-10-28 21:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-28 21:58 Kevin Nomura [this message]
2003-10-29 22:27 ` Andrew Cagney
2003-10-29 22:30   ` Daniel Jacobowitz
2003-10-29 22:43     ` Kevin Nomura
2003-10-29 22:50     ` 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=20031028215814.GY4320@bughouse.netapp.com \
    --to=nomura@netapp.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