Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@cygnus.com>
To: cagney@redhat.com, gdb-patches@sources.redhat.com
Subject: [RFA] regcache pseudo-reg tweak
Date: Tue, 05 Feb 2002 18:33:00 -0000	[thread overview]
Message-ID: <200202060226.g162QY120181@reddwarf.cygnus.com> (raw)


Andrew, 

I think you left out an "else" when you made this change in december.
We must not call target_[fetch/store]_register with a pseudo-register, 
or they will choke.  By definition, a pseudo-register is one that 
cannot be fetched from the target.

Remote_fetch_register, for instance, aborts on this.

Michael

2002-02-05  Michael Snyder  <msnyder@redhat.com>

	* regcache.c (fetch_register): Don't call target_fetch_register
	for a pseudo_register.
	(store_register): Don't call target_store_register for a
	pseudo_register.

Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.31
diff -c -3 -p -r1.31 regcache.c
*** regcache.c	2002/01/29 20:24:27	1.31
--- regcache.c	2002/02/06 02:30:46
*************** fetch_register (int regnum)
*** 125,131 ****
    if (FETCH_PSEUDO_REGISTER_P ()
        && pseudo_register (regnum))
      FETCH_PSEUDO_REGISTER (regnum);
!   target_fetch_registers (regnum);
  }
  
  /* Write register REGNUM cached value to the target.  */
--- 125,132 ----
    if (FETCH_PSEUDO_REGISTER_P ()
        && pseudo_register (regnum))
      FETCH_PSEUDO_REGISTER (regnum);
!   else if (real_register (regnum))
!     target_fetch_registers (regnum);
  }
  
  /* Write register REGNUM cached value to the target.  */
*************** store_register (int regnum)
*** 140,146 ****
    if (STORE_PSEUDO_REGISTER_P ()
        && pseudo_register (regnum))
      STORE_PSEUDO_REGISTER (regnum);
!   target_store_registers (regnum);
  }
  
  /* Low level examining and depositing of registers.
--- 141,148 ----
    if (STORE_PSEUDO_REGISTER_P ()
        && pseudo_register (regnum))
      STORE_PSEUDO_REGISTER (regnum);
!   else if (real_register (regnum))
!     target_store_registers (regnum);
  }
  
  /* Low level examining and depositing of registers.


             reply	other threads:[~2002-02-06  2:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-05 18:33 Michael Snyder [this message]
2002-02-05 19:11 ` Andrew Cagney
2002-02-05 19:17   ` Michael Snyder

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=200202060226.g162QY120181@reddwarf.cygnus.com \
    --to=msnyder@cygnus.com \
    --cc=cagney@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