Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Fix pending register stores in mips simulator
Date: Wed, 04 Apr 2001 20:25:00 -0000	[thread overview]
Message-ID: <20010405032559.C594E5E9CB@zwingli.cygnus.com> (raw)

Without this patch, the CFC1 and CTC1 instructions queue pending
register stores off the end of the register array.  In my test
program, this ended up up zeroing elements in the CPU's register_width
array.  The sim refuse to provide the values of the registers whose
widths are zero, which confuses GDB.

2001-04-04  Jim Blandy  <jimb@redhat.com>

	* mips.igen (CFC1, CTC1): Pass the correct register numbers to
	PENDING_FILL.  Use PENDING_SCHED directly to handle the pending
	set of the FCSR.
	* sim-main.h (COCIDX): Remove definition; this isn't supported by
	PENDING_FILL, and you can get the intended effect gracefully by
	calling PENDING_SCHED directly.

Index: sim/mips/mips.igen
===================================================================
RCS file: /cvs/cvsfiles/devo/sim/mips/mips.igen,v
retrieving revision 1.86.72.1
diff -c -r1.86.72.1 mips.igen
*** sim/mips/mips.igen	2001/01/25 08:33:38	1.86.72.1
--- sim/mips/mips.igen	2001/04/05 03:05:08
***************
*** 2967,2977 ****
    if (X)
      {
        if (FS == 0)
! 	PENDING_FILL((FS + FCR0IDX),VL4_8(GPR[RT]));
        else if (FS == 31)
! 	PENDING_FILL((FS + FCR31IDX),VL4_8(GPR[RT]));
        /* else NOP */
!       PENDING_FILL(COCIDX,0); /* special case */
      }
    else
      { /* control from */
--- 2967,2977 ----
    if (X)
      {
        if (FS == 0)
! 	PENDING_FILL(FCR0IDX,VL4_8(GPR[RT]));
        else if (FS == 31)
! 	PENDING_FILL(FCR31IDX,VL4_8(GPR[RT]));
        /* else NOP */
!       PENDING_SCHED(FCSR, FCR31 & (1<<23), 1, 23);
      }
    else
      { /* control from */
Index: sim/mips/sim-main.h
===================================================================
RCS file: /cvs/cvsfiles/devo/sim/mips/sim-main.h,v
retrieving revision 1.88.40.1
diff -c -r1.88.40.1 sim-main.h
*** sim/mips/sim-main.h	2001/01/25 08:33:39	1.88.40.1
--- sim/mips/sim-main.h	2001/04/05 03:05:09
***************
*** 404,410 ****
  #define Debug	(REGISTERS[86])
  #define DEPC	(REGISTERS[87])
  #define EPC	(REGISTERS[88])
- #define COCIDX  (LAST_EMBED_REGNUM + 2) /* special case : outside the normal range */
  
    /* All internal state modified by signal_exception() that may need to be
       rolled back for passing moment-of-exception image back to gdb. */
--- 404,409 ----


             reply	other threads:[~2001-04-04 20:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-04 20:25 Jim Blandy [this message]
2001-04-06  9:10 ` 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=20010405032559.C594E5E9CB@zwingli.cygnus.com \
    --to=jimb@zwingli.cygnus.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