Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Richard.Earnshaw@arm.com, gdb@sources.redhat.com
Subject: Re: frame_register_read()
Date: Tue, 14 May 2002 09:00:00 -0000	[thread overview]
Message-ID: <200205141559.QAA23440@cam-mail2.cambridge.arm.com> (raw)
In-Reply-To: Your message of "Tue, 14 May 2002 10:41:25 EDT." <3CE12215.1020308@cygnus.com>

> > Andrew,
> > 
> > frame_register_read() contains the comment
> > 
> >   /* FIXME: cagney/2002-04-10: This test is just bogus.  It is no
> >      indication of the validity of the register.  The value could
> >      easily be found (on the stack) even though the corresponding
> >      register isn't available.  */
> >   if (register_cached (regnum) < 0)
> >     return 0;                   /* register value not available */
> > 
> > But in regcache.c we have
> > 
> > /* REGISTER_VALID is 0 if the register needs to be fetched,
> >                      1 if it has been fetched, and
> >                     -1 if the register value was not available.  
> >    "Not available" means don't try to fetch it again.  */
> > 
> > So why is the code in frame_register_read incorrect?  It's simply testing 
> > that the register exists for this target.  If it doesn't exist, then how 
> > can it be recovered from the stack?
> 
> Introspect (tracepoints, target snapshots) do this.  If a specific 
> snapshot doesn't contain a register then the register is unavailable. 
> The corresponding hardware still has the register so its value can be 
> found on the stack.

So it seems the comment in regcache.c is incomplete/misleading.  Could you 
clarify it?

R.


      reply	other threads:[~2002-05-14 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-14  3:19 frame_register_read() Richard Earnshaw
2002-05-14  7:41 ` frame_register_read() Andrew Cagney
2002-05-14  9:00   ` Richard Earnshaw [this message]

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=200205141559.QAA23440@cam-mail2.cambridge.arm.com \
    --to=rearnsha@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb@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