* readelf.c (dump_section): Don't print 32-bit values, which
[deliverable/binutils-gdb.git] / gdb / varobj.c
index a9f8ee07984e9643eaf19c690a3ed99e6834fa34..766fd398b735d51b47f39f62cdcf268513235c78 100644 (file)
@@ -1441,7 +1441,8 @@ get_type (struct varobj *var)
   return type;
 }
 
-/* This returns the type of the variable, dereferencing pointers, too. */
+/* This returns the type of the variable, dereferencing references, pointers
+   and references to pointers, too. */
 static struct type *
 get_type_deref (struct varobj *var)
 {
@@ -1449,9 +1450,13 @@ get_type_deref (struct varobj *var)
 
   type = get_type (var);
 
-  if (type != NULL && (TYPE_CODE (type) == TYPE_CODE_PTR
-                      || TYPE_CODE (type) == TYPE_CODE_REF))
-    type = get_target_type (type);
+  if (type)
+    {
+      if (TYPE_CODE (type) == TYPE_CODE_REF)
+       type = get_target_type (type);
+      if (TYPE_CODE (type) == TYPE_CODE_PTR)
+       type = get_target_type (type);
+    }
 
   return type;
 }
@@ -1726,9 +1731,9 @@ c_number_of_children (struct varobj *var)
       break;
 
     case TYPE_CODE_PTR:
-      /* This is where things get compilcated. All pointers have one child.
+      /* This is where things get complicated. All pointers have one child.
          Except, of course, for struct and union ptr, which we automagically
-         dereference for the user and function ptrs, which have no children.
+         dereference for the user, and function ptrs which have no children.
          We also don't dereference void* as we don't know what to show.
          We can show char* so we allow it to be dereferenced.  If you decide
          to test for it, please mind that a little magic is necessary to
@@ -1908,7 +1913,7 @@ c_name_of_child (struct varobj *parent, int index)
 static struct value *
 c_value_of_root (struct varobj **var_handle)
 {
-  struct value *new_val;
+  struct value *new_val = NULL;
   struct varobj *var = *var_handle;
   struct frame_info *fi;
   int within_scope;
This page took 0.023693 seconds and 4 git commands to generate.