This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Revise comments about "not available"
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com,Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Tue, 14 May 2002 21:01:20 -0400
- Subject: [patch] Revise comments about "not available"
The attached should help a little. Adding more comments is obvious.
committed,
Andrew
2002-05-14 Andrew Cagney <ac131313@redhat.com>
* regcache.c (register_valid): Revise comments refering to "Not
available" and "unavailable".
* frame.c (frame_register_read): Ditto.
* findvar.c (value_of_register): Ditto.
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.33
diff -u -r1.33 findvar.c
--- findvar.c 12 May 2002 03:09:11 -0000 1.33
+++ findvar.c 15 May 2002 00:58:06 -0000
@@ -308,6 +308,13 @@
get_saved_register (raw_buffer, &optim, &addr,
frame, regnum, &lval);
+ /* FIXME: cagney/2002-05-15: This test is just bogus.
+
+ It indicates that the target failed to supply a value for a
+ register because it was "not available" at this time. Problem
+ is, the target still has the register and so get saved_register()
+ may be returning a value saved on the stack. */
+
if (register_cached (regnum) < 0)
return NULL; /* register value not available */
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.9
diff -u -r1.9 frame.c
--- frame.c 21 Apr 2002 15:52:34 -0000 1.9
+++ frame.c 15 May 2002 00:58:06 -0000
@@ -157,10 +157,13 @@
get_saved_register (myaddr, &optim, (CORE_ADDR *) NULL, frame,
regnum, (enum lval_type *) NULL);
- /* 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. */
+ /* FIXME: cagney/2002-05-15: This test, is just bogus.
+
+ It indicates that the target failed to supply a value for a
+ register because it was "not available" at this time. Problem
+ is, the target still has the register and so get saved_register()
+ may be returning a value saved on the stack. */
+
if (register_cached (regnum) < 0)
return 0; /* register value not available */
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.35
diff -u -r1.35 regcache.c
--- regcache.c 13 May 2002 17:20:58 -0000 1.35
+++ regcache.c 15 May 2002 00:58:08 -0000
@@ -45,7 +45,13 @@
/* 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. */
+
+ "Not available" indicates that the target is not not able to supply
+ the register at this state. The register may become available at a
+ later time (after the next resume). This often occures when GDB is
+ manipulating a target that contains only a snapshot of the entire
+ system being debugged - some of the registers in such a system may
+ not have been saved. */
signed char *register_valid;