This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] varobj.c: Use wrapper for value_struct_elt
- To: <gdb-patches at sources dot redhat dot com>
- Subject: [RFA] varobj.c: Use wrapper for value_struct_elt
- From: Keith Seitz <keiths at cygnus dot com>
- Date: Tue, 30 Oct 2001 19:28:58 -0800 (PST)
Hi,
This patch (which I guess is obvious to me) switches varobj.c from calling
the unwrapped gdb function value_struct_elt to using the recently approved
wrapper function.
This is one of several patches I will be submitting to get C++ working
again for varobj.
Keith
ChangeLog
2001-10-30 Keith Seitz <keiths@redhat.com>
* varobj.c (c_value_of_child): Use the wrapper function,
gdb_value_struct_elt.
(cplus_value_of_child): Likewise.
Patch
Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.21
diff -u -p -r1.21 varobj.c
--- varobj.c 2001/10/10 17:01:52 1.21
+++ varobj.c 2001/10/31 03:28:33
@@ -1950,7 +1950,7 @@ c_value_of_child (struct varobj *parent,
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- value = value_struct_elt (&temp, NULL, name, NULL, "vstructure");
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL, "vstructure");
break;
case TYPE_CODE_PTR:
@@ -1958,7 +1958,7 @@ c_value_of_child (struct varobj *parent,
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- value = value_struct_elt (&temp, NULL, name, NULL, "vstructure");
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL, "vstructure");
break;
default:
@@ -2295,9 +2295,11 @@ cplus_value_of_child (struct varobj *par
if (CPLUS_FAKE_CHILD (parent))
{
value_ptr temp = parent->parent->value;
- value = value_struct_elt (&temp, NULL, name,
- NULL, "cplus_structure");
- release_value (value);
+
+ gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL,
+ "cplus_structure");
+ if (value != NULL)
+ release_value (value);
}
else if (index >= TYPE_N_BASECLASSES (type))
{