This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: frame_register_read()
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: Richard dot Earnshaw at arm dot com, gdb at sources dot redhat dot com
- Date: Tue, 14 May 2002 16:59:45 +0100
- Subject: Re: frame_register_read()
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot 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.