Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Michael Snyder <msnyder@cygnus.com>
Cc: cagney@redhat.com, gdb-patches@sources.redhat.com
Subject: Re: [RFA] regcache pseudo-reg tweak
Date: Tue, 05 Feb 2002 19:11:00 -0000	[thread overview]
Message-ID: <3C609ECE.7020300@cygnus.com> (raw)
In-Reply-To: <200202060226.g162QY120181@reddwarf.cygnus.com>

> 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.


Oops, kind of.


> 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.  */


There should be an else but not else if (real_register ()) ....


A target can handle registers two ways - using pseudo-registers or using 
register_{read,write}().  If a target uses the latter then it will 
likely end up fetching registers in the pseudo-register range from the 
target.

A simple example of this might be a modified x86 where not only the user 
registers but also the system registers (MSRs?) are accessable.  The 
MSR's wouldn't be returned via the G packet but instead fetched 
individually.  Unfortunatly, NUM_REGS determines which registers are 
included in a G packet (and many other obscure things).

Andrew




  reply	other threads:[~2002-02-06  3:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-05 18:33 Michael Snyder
2002-02-05 19:11 ` Andrew Cagney [this message]
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=3C609ECE.7020300@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=cagney@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@cygnus.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