This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Use new wrapper in varobj.c


Hi,

Well, now that the wrapper has been approved, I figure using the wrappers
qualifies for an obvious fix.

Keith

ChangeLog
2001-11-19  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.23
diff -u -p -r1.23 varobj.c
--- varobj.c	2001/11/01 02:37:56	1.23
+++ varobj.c	2001/11/19 19:27:10
@@ -1952,7 +1952,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:
@@ -1960,8 +1960,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:
@@ -2298,9 +2297,11 @@ cplus_value_of_child (struct varobj *par
       if (CPLUS_FAKE_CHILD (parent))
 	{
 	  struct value *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))
 	{


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]