Display the contents of a .debug.macinfo section
[deliverable/binutils-gdb.git] / gdb / varobj.c
index 97e2a4e356b1ba12bc7f827bc04801789a2dbc6d..c62aecffd65fd0aacf1f95e93a91c4fcf83f8fcd 100644 (file)
@@ -20,7 +20,6 @@
 #include "value.h"
 #include "expression.h"
 #include "frame.h"
-#include "valprint.h"
 #include "language.h"
 #include "wrapper.h"
 #include "gdbcmd.h"
@@ -1640,7 +1639,7 @@ value_of_root (struct varobj **var_handle, int *type_changed)
            {
              tmp_var->obj_name = 
                savestring (var->obj_name, strlen (var->obj_name));
-             uninstall_variable (var);
+             varobj_delete (var, NULL, 0);
            }
          else
            {
@@ -1762,7 +1761,13 @@ c_number_of_children (struct varobj *var)
     case TYPE_CODE_PTR:
       /* This is where things get compilcated. 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
+         properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and 
+         TYPE_NAME == "char" */
+
       switch (TYPE_CODE (target))
        {
        case TYPE_CODE_STRUCT:
@@ -1771,17 +1776,12 @@ c_number_of_children (struct varobj *var)
          break;
 
        case TYPE_CODE_FUNC:
+       case TYPE_CODE_VOID:
          children = 0;
          break;
 
        default:
-         /* Don't dereference char* or void*. */
-         if (TYPE_NAME (target) != NULL
-             && (STREQ (TYPE_NAME (target), "char")
-                 || STREQ (TYPE_NAME (target), "void")))
-           children = 0;
-         else
-           children = 1;
+         children = 1;
        }
       break;
 
This page took 0.024019 seconds and 4 git commands to generate.