gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / ada-varobj.c
index b9f83be6ad78e5d4d422812a5938328c25f50f41..485eae29b92573ce0d6bfc5adcf58be6bb793b76 100644 (file)
@@ -1,6 +1,6 @@
 /* varobj support for Ada.
 
-   Copyright (C) 2012-2014 Free Software Foundation, Inc.
+   Copyright (C) 2012-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -74,22 +74,15 @@ ada_varobj_decode_var (struct value **value_ptr, struct type **type_ptr)
 /* Return a string containing an image of the given scalar value.
    VAL is the numeric value, while TYPE is the value's type.
    This is useful for plain integers, of course, but even more
-   so for enumerated types.
+   so for enumerated types.  */
 
-   The result should be deallocated by xfree after use.  */
-
-static char *
+static std::string
 ada_varobj_scalar_image (struct type *type, LONGEST val)
 {
-  struct ui_file *buf = mem_fileopen ();
-  struct cleanup *cleanups = make_cleanup_ui_file_delete (buf);
-  char *result;
-
-  ada_print_scalar (type, val, buf);
-  result = ui_file_xstrdup (buf, NULL);
-  do_cleanups (cleanups);
+  string_file buf;
 
-  return result;
+  ada_print_scalar (type, val, &buf);
+  return std::move (buf.string ());
 }
 
 /* Assuming that the (PARENT_VALUE, PARENT_TYPE) pair designates
@@ -139,11 +132,11 @@ ada_varobj_ind (struct value *parent_value,
         ada_get_decoded_value would have transformed our parent_type
         into a simple array pointer type.  */
       gdb_assert (parent_value == NULL);
-      gdb_assert (TYPE_CODE (parent_type) == TYPE_CODE_TYPEDEF);
+      gdb_assert (parent_type->code () == TYPE_CODE_TYPEDEF);
 
       /* Decode parent_type by the equivalent pointer to (decoded)
         array.  */
-      while (TYPE_CODE (parent_type) == TYPE_CODE_TYPEDEF)
+      while (parent_type->code () == TYPE_CODE_TYPEDEF)
        parent_type = TYPE_TARGET_TYPE (parent_type);
       parent_type = ada_coerce_to_simple_array_type (parent_type);
       parent_type = lookup_pointer_type (parent_type);
@@ -213,9 +206,9 @@ ada_varobj_adjust_for_child_access (struct value **value,
       one child (the struct), their children are the components of
       the struct/union type.  We handle this situation by dereferencing
       the (value, type) couple.  */
-  if (TYPE_CODE (*type) == TYPE_CODE_PTR
-      && (TYPE_CODE (TYPE_TARGET_TYPE (*type)) == TYPE_CODE_STRUCT
-          || TYPE_CODE (TYPE_TARGET_TYPE (*type)) == TYPE_CODE_UNION)
+  if ((*type)->code () == TYPE_CODE_PTR
+      && (TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_STRUCT
+          || TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_UNION)
       && !ada_is_array_descriptor_type (TYPE_TARGET_TYPE (*type))
       && !ada_is_constrained_packed_array_type (TYPE_TARGET_TYPE (*type)))
     ada_varobj_ind (*value, *type, value, type);
@@ -240,6 +233,18 @@ ada_varobj_get_array_number_of_children (struct value *parent_value,
 {
   LONGEST lo, hi;
 
+  if (parent_value == NULL
+      && is_dynamic_type (TYPE_INDEX_TYPE (parent_type)))
+    {
+      /* This happens when listing the children of an object
+        which does not exist in memory (Eg: when requesting
+        the children of a null pointer, which is allowed by
+        varobj).  The array index type being dynamic, we cannot
+        determine how many elements this array has.  Just assume
+        it has none.  */
+      return 0;
+    }
+
   if (!get_array_bounds (parent_type, &lo, &hi))
     {
       /* Could not get the array bounds.  Pretend this is an empty array.  */
@@ -265,10 +270,10 @@ ada_varobj_get_struct_number_of_children (struct value *parent_value,
   int n_children = 0;
   int i;
 
-  gdb_assert (TYPE_CODE (parent_type) == TYPE_CODE_STRUCT
-             || TYPE_CODE (parent_type) == TYPE_CODE_UNION);
+  gdb_assert (parent_type->code () == TYPE_CODE_STRUCT
+             || parent_type->code () == TYPE_CODE_UNION);
 
-  for (i = 0; i < TYPE_NFIELDS (parent_type); i++)
+  for (i = 0; i < parent_type->num_fields (); i++)
     {
       if (ada_is_ignored_field (parent_type, i))
        continue;
@@ -324,8 +329,8 @@ ada_varobj_get_ptr_number_of_children (struct value *parent_value,
 
   /* Pointer to functions and to void do not have a child, since
      you cannot print what they point to.  */
-  if (TYPE_CODE (child_type) == TYPE_CODE_FUNC
-      || TYPE_CODE (child_type) == TYPE_CODE_VOID)
+  if (child_type->code () == TYPE_CODE_FUNC
+      || child_type->code () == TYPE_CODE_VOID)
     return 0;
 
   /* All other types have 1 child.  */
@@ -345,20 +350,19 @@ ada_varobj_get_number_of_children (struct value *parent_value,
   /* A typedef to an array descriptor in fact represents a pointer
      to an unconstrained array.  These types always have one child
      (the unconstrained array).  */
-  if (ada_is_array_descriptor_type (parent_type)
-      && TYPE_CODE (parent_type) == TYPE_CODE_TYPEDEF)
+  if (ada_is_access_to_unconstrained_array (parent_type))
     return 1;
 
-  if (TYPE_CODE (parent_type) == TYPE_CODE_ARRAY)
+  if (parent_type->code () == TYPE_CODE_ARRAY)
     return ada_varobj_get_array_number_of_children (parent_value,
                                                    parent_type);
 
-  if (TYPE_CODE (parent_type) == TYPE_CODE_STRUCT
-      || TYPE_CODE (parent_type) == TYPE_CODE_UNION)
+  if (parent_type->code () == TYPE_CODE_STRUCT
+      || parent_type->code () == TYPE_CODE_UNION)
     return ada_varobj_get_struct_number_of_children (parent_value,
                                                     parent_type);
 
-  if (TYPE_CODE (parent_type) == TYPE_CODE_PTR)
+  if (parent_type->code () == TYPE_CODE_PTR)
     return ada_varobj_get_ptr_number_of_children (parent_value,
                                                  parent_type);
 
@@ -392,10 +396,10 @@ static void ada_varobj_describe_child (struct value *parent_value,
                                       const char *parent_name,
                                       const char *parent_path_expr,
                                       int child_index,
-                                      char **child_name,
+                                      std::string *child_name,
                                       struct value **child_value,
                                       struct type **child_type,
-                                      char **child_path_expr);
+                                      std::string *child_path_expr);
 
 /* Same as ada_varobj_describe_child, but limited to struct/union
    objects.  */
@@ -406,17 +410,18 @@ ada_varobj_describe_struct_child (struct value *parent_value,
                                  const char *parent_name,
                                  const char *parent_path_expr,
                                  int child_index,
-                                 char **child_name,
+                                 std::string *child_name,
                                  struct value **child_value,
                                  struct type **child_type,
-                                 char **child_path_expr)
+                                 std::string *child_path_expr)
 {
   int fieldno;
   int childno = 0;
 
-  gdb_assert (TYPE_CODE (parent_type) == TYPE_CODE_STRUCT);
+  gdb_assert (parent_type->code () == TYPE_CODE_STRUCT
+             || parent_type->code () == TYPE_CODE_UNION);
 
-  for (fieldno = 0; fieldno < TYPE_NFIELDS (parent_type); fieldno++)
+  for (fieldno = 0; fieldno < parent_type->num_fields (); fieldno++)
     {
       if (ada_is_ignored_field (parent_type, fieldno))
        continue;
@@ -494,7 +499,7 @@ ada_varobj_describe_struct_child (struct value *parent_value,
              const char *field_name = TYPE_FIELD_NAME (parent_type, fieldno);
              int child_name_len = ada_name_prefix_len (field_name);
 
-             *child_name = xstrprintf ("%.*s", child_name_len, field_name);
+             *child_name = string_printf ("%.*s", child_name_len, field_name);
            }
 
          if (child_value && parent_value)
@@ -515,8 +520,8 @@ ada_varobj_describe_struct_child (struct value *parent_value,
              int child_name_len = ada_name_prefix_len (field_name);
 
              *child_path_expr =
-               xstrprintf ("(%s).%.*s", parent_path_expr,
-                           child_name_len, field_name);
+               string_printf ("(%s).%.*s", parent_path_expr,
+                              child_name_len, field_name);
            }
 
          return;
@@ -544,13 +549,13 @@ ada_varobj_describe_ptr_child (struct value *parent_value,
                               const char *parent_name,
                               const char *parent_path_expr,
                               int child_index,
-                              char **child_name,
+                              std::string *child_name,
                               struct value **child_value,
                               struct type **child_type,
-                              char **child_path_expr)
+                              std::string *child_path_expr)
 {
   if (child_name)
-    *child_name = xstrprintf ("%s.all", parent_name);
+    *child_name = string_printf ("%s.all", parent_name);
 
   if (child_value && parent_value)
     ada_varobj_ind (parent_value, parent_type, child_value, NULL);
@@ -559,7 +564,7 @@ ada_varobj_describe_ptr_child (struct value *parent_value,
     ada_varobj_ind (parent_value, parent_type, NULL, child_type);
 
   if (child_path_expr)
-    *child_path_expr = xstrprintf ("(%s).all", parent_path_expr);
+    *child_path_expr = string_printf ("(%s).all", parent_path_expr);
 }
 
 /* Same as ada_varobj_describe_child, limited to simple array objects
@@ -574,15 +579,15 @@ ada_varobj_describe_simple_array_child (struct value *parent_value,
                                        const char *parent_name,
                                        const char *parent_path_expr,
                                        int child_index,
-                                       char **child_name,
+                                       std::string *child_name,
                                        struct value **child_value,
                                        struct type **child_type,
-                                       char **child_path_expr)
+                                       std::string *child_path_expr)
 {
   struct type *index_type;
   int real_index;
 
-  gdb_assert (TYPE_CODE (parent_type) == TYPE_CODE_ARRAY);
+  gdb_assert (parent_type->code () == TYPE_CODE_ARRAY);
 
   index_type = TYPE_INDEX_TYPE (parent_type);
   real_index = child_index + ada_discrete_type_low_bound (index_type);
@@ -600,8 +605,7 @@ ada_varobj_describe_simple_array_child (struct value *parent_value,
 
   if (child_path_expr)
     {
-      char *index_img = ada_varobj_scalar_image (index_type, real_index);
-      struct cleanup *cleanups = make_cleanup (xfree, index_img);
+      std::string index_img = ada_varobj_scalar_image (index_type, real_index);
 
       /* Enumeration litterals by themselves are potentially ambiguous.
         For instance, consider the following package spec:
@@ -620,28 +624,31 @@ ada_varobj_describe_simple_array_child (struct value *parent_value,
         of the array index type when such type qualification is
         needed.  */
       const char *index_type_name = NULL;
+      std::string decoded;
 
       /* If the index type is a range type, find the base type.  */
-      while (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
+      while (index_type->code () == TYPE_CODE_RANGE)
        index_type = TYPE_TARGET_TYPE (index_type);
 
-      if (TYPE_CODE (index_type) == TYPE_CODE_ENUM
-         || TYPE_CODE (index_type) == TYPE_CODE_BOOL)
+      if (index_type->code () == TYPE_CODE_ENUM
+         || index_type->code () == TYPE_CODE_BOOL)
        {
          index_type_name = ada_type_name (index_type);
          if (index_type_name)
-           index_type_name = ada_decode (index_type_name);
+           {
+             decoded = ada_decode (index_type_name);
+             index_type_name = decoded.c_str ();
+           }
        }
 
       if (index_type_name != NULL)
        *child_path_expr =
-         xstrprintf ("(%s)(%.*s'(%s))", parent_path_expr,
-                     ada_name_prefix_len (index_type_name),
-                     index_type_name, index_img);
+         string_printf ("(%s)(%.*s'(%s))", parent_path_expr,
+                        ada_name_prefix_len (index_type_name),
+                        index_type_name, index_img.c_str ());
       else
        *child_path_expr =
-         xstrprintf ("(%s)(%s)", parent_path_expr, index_img);
-      do_cleanups (cleanups);
+         string_printf ("(%s)(%s)", parent_path_expr, index_img.c_str ());
     }
 }
 
@@ -653,10 +660,10 @@ ada_varobj_describe_child (struct value *parent_value,
                           const char *parent_name,
                           const char *parent_path_expr,
                           int child_index,
-                          char **child_name,
+                          std::string *child_name,
                           struct value **child_value,
                           struct type **child_type,
-                          char **child_path_expr)
+                          std::string *child_path_expr)
 {
   /* We cannot compute the child's path expression without
      the parent's path expression.  This is a pre-condition
@@ -668,16 +675,15 @@ ada_varobj_describe_child (struct value *parent_value,
   ada_varobj_adjust_for_child_access (&parent_value, &parent_type);
 
   if (child_name)
-    *child_name = NULL;
+    *child_name = std::string ();
   if (child_value)
     *child_value = NULL;
   if (child_type)
     *child_type = NULL;
   if (child_path_expr)
-    *child_path_expr = NULL;
+    *child_path_expr = std::string ();
 
-  if (ada_is_array_descriptor_type (parent_type)
-      && TYPE_CODE (parent_type) == TYPE_CODE_TYPEDEF)
+  if (ada_is_access_to_unconstrained_array (parent_type))
     {
       ada_varobj_describe_ptr_child (parent_value, parent_type,
                                     parent_name, parent_path_expr,
@@ -687,7 +693,7 @@ ada_varobj_describe_child (struct value *parent_value,
       return;
     }
 
-  if (TYPE_CODE (parent_type) == TYPE_CODE_ARRAY)
+  if (parent_type->code () == TYPE_CODE_ARRAY)
     {
       ada_varobj_describe_simple_array_child
        (parent_value, parent_type, parent_name, parent_path_expr,
@@ -696,7 +702,8 @@ ada_varobj_describe_child (struct value *parent_value,
       return;
     }
 
-  if (TYPE_CODE (parent_type) == TYPE_CODE_STRUCT)
+  if (parent_type->code () == TYPE_CODE_STRUCT
+      || parent_type->code () == TYPE_CODE_UNION)
     {
       ada_varobj_describe_struct_child (parent_value, parent_type,
                                        parent_name, parent_path_expr,
@@ -706,7 +713,7 @@ ada_varobj_describe_child (struct value *parent_value,
       return;
     }
 
-  if (TYPE_CODE (parent_type) == TYPE_CODE_PTR)
+  if (parent_type->code () == TYPE_CODE_PTR)
     {
       ada_varobj_describe_ptr_child (parent_value, parent_type,
                                     parent_name, parent_path_expr,
@@ -719,20 +726,18 @@ ada_varobj_describe_child (struct value *parent_value,
   /* It should never happen.  But rather than crash, report dummy names
      and return a NULL child_value.  */
   if (child_name)
-    *child_name = xstrdup ("???");
+    *child_name = "???";
 }
 
 /* Return the name of the child number CHILD_INDEX of the (PARENT_VALUE,
-   PARENT_TYPE) pair.  PARENT_NAME is the name of the PARENT.
-
-   The result should be deallocated after use with xfree.  */
+   PARENT_TYPE) pair.  PARENT_NAME is the name of the PARENT.  */
 
-static char *
+static std::string
 ada_varobj_get_name_of_child (struct value *parent_value,
                              struct type *parent_type,
                              const char *parent_name, int child_index)
 {
-  char *child_name;
+  std::string child_name;
 
   ada_varobj_describe_child (parent_value, parent_type, parent_name,
                             NULL, child_index, &child_name, NULL,
@@ -743,18 +748,16 @@ ada_varobj_get_name_of_child (struct value *parent_value,
 /* Return the path expression of the child number CHILD_INDEX of
    the (PARENT_VALUE, PARENT_TYPE) pair.  PARENT_NAME is the name
    of the parent, and PARENT_PATH_EXPR is the parent's path expression.
-   Both must be non-NULL.
+   Both must be non-NULL.  */
 
-   The result must be deallocated after use with xfree.  */
-
-static char *
+static std::string
 ada_varobj_get_path_expr_of_child (struct value *parent_value,
                                   struct type *parent_type,
                                   const char *parent_name,
                                   const char *parent_path_expr,
                                   int child_index)
 {
-  char *child_path_expr;
+  std::string child_path_expr;
 
   ada_varobj_describe_child (parent_value, parent_type, parent_name,
                             parent_path_expr, child_index, NULL,
@@ -801,22 +804,14 @@ ada_varobj_get_type_of_child (struct value *parent_value,
 
    The resulting string must be deallocated after use with xfree.  */
 
-static char *
+static std::string
 ada_varobj_get_value_image (struct value *value,
                            struct value_print_options *opts)
 {
-  char *result;
-  struct ui_file *buffer;
-  struct cleanup *old_chain;
-
-  buffer = mem_fileopen ();
-  old_chain = make_cleanup_ui_file_delete (buffer);
+  string_file buffer;
 
-  common_val_print (value, buffer, 0, opts, current_language);
-  result = ui_file_xstrdup (buffer, NULL);
-
-  do_cleanups (old_chain);
-  return result;
+  common_val_print (value, &buffer, 0, opts, current_language);
+  return std::move (buffer.string ());
 }
 
 /* Assuming that the (VALUE, TYPE) pair designates an array varobj,
@@ -829,12 +824,11 @@ ada_varobj_get_value_image (struct value *value,
 
    The result should be deallocated after use using xfree.  */
 
-static char *
+static std::string
 ada_varobj_get_value_of_array_variable (struct value *value,
                                        struct type *type,
                                        struct value_print_options *opts)
 {
-  char *result;
   const int numchild = ada_varobj_get_array_number_of_children (value, type);
 
   /* If we have a string, provide its contents in the "value" field.
@@ -845,123 +839,114 @@ ada_varobj_get_value_of_array_variable (struct value *value,
       && ada_is_string_type (type)
       && (opts->format == 0 || opts->format == 's'))
     {
-      char *str;
-      struct cleanup *old_chain;
-
-      str = ada_varobj_get_value_image (value, opts);
-      old_chain = make_cleanup (xfree, str);
-      result = xstrprintf ("[%d] %s", numchild, str);
-      do_cleanups (old_chain);
+      std::string str = ada_varobj_get_value_image (value, opts);
+      return string_printf ("[%d] %s", numchild, str.c_str ());
     }
   else
-    result = xstrprintf ("[%d]", numchild);
-
-  return result;
+    return string_printf ("[%d]", numchild);
 }
 
 /* Return a string representation of the (VALUE, TYPE) pair, using
    the given print options OPTS as our formatting options.  */
 
-static char *
+static std::string
 ada_varobj_get_value_of_variable (struct value *value,
                                  struct type *type,
                                  struct value_print_options *opts)
 {
-  char *result = NULL;
-
   ada_varobj_decode_var (&value, &type);
 
-  switch (TYPE_CODE (type))
+  switch (type->code ())
     {
     case TYPE_CODE_STRUCT:
     case TYPE_CODE_UNION:
-      result = xstrdup ("{...}");
-      break;
+      return "{...}";
     case TYPE_CODE_ARRAY:
-      result = ada_varobj_get_value_of_array_variable (value, type, opts);
-      break;
+      return ada_varobj_get_value_of_array_variable (value, type, opts);
     default:
       if (!value)
-       result = xstrdup ("");
+       return "";
       else
-       result = ada_varobj_get_value_image (value, opts);
-      break;
+       return ada_varobj_get_value_image (value, opts);
     }
-
-  return result;
 }
 
 /* Ada specific callbacks for VAROBJs.  */
 
 static int
-ada_number_of_children (struct varobj *var)
+ada_number_of_children (const struct varobj *var)
 {
-  return ada_varobj_get_number_of_children (var->value, var->type);
+  return ada_varobj_get_number_of_children (var->value.get (), var->type);
 }
 
-static char *
-ada_name_of_variable (struct varobj *parent)
+static std::string
+ada_name_of_variable (const struct varobj *parent)
 {
   return c_varobj_ops.name_of_variable (parent);
 }
 
-static char *
-ada_name_of_child (struct varobj *parent, int index)
+static std::string
+ada_name_of_child (const struct varobj *parent, int index)
 {
-  return ada_varobj_get_name_of_child (parent->value, parent->type,
-                                      parent->name, index);
+  return ada_varobj_get_name_of_child (parent->value.get (), parent->type,
+                                      parent->name.c_str (), index);
 }
 
-static char*
-ada_path_expr_of_child (struct varobj *child)
+static std::string
+ada_path_expr_of_child (const struct varobj *child)
 {
-  struct varobj *parent = child->parent;
+  const struct varobj *parent = child->parent;
   const char *parent_path_expr = varobj_get_path_expr (parent);
 
-  return ada_varobj_get_path_expr_of_child (parent->value,
+  return ada_varobj_get_path_expr_of_child (parent->value.get (),
                                            parent->type,
-                                           parent->name,
+                                           parent->name.c_str (),
                                            parent_path_expr,
                                            child->index);
 }
 
 static struct value *
-ada_value_of_child (struct varobj *parent, int index)
+ada_value_of_child (const struct varobj *parent, int index)
 {
-  return ada_varobj_get_value_of_child (parent->value, parent->type,
-                                       parent->name, index);
+  return ada_varobj_get_value_of_child (parent->value.get (), parent->type,
+                                       parent->name.c_str (), index);
 }
 
 static struct type *
-ada_type_of_child (struct varobj *parent, int index)
+ada_type_of_child (const struct varobj *parent, int index)
 {
-  return ada_varobj_get_type_of_child (parent->value, parent->type,
+  return ada_varobj_get_type_of_child (parent->value.get (), parent->type,
                                       index);
 }
 
-static char *
-ada_value_of_variable (struct varobj *var, enum varobj_display_formats format)
+static std::string
+ada_value_of_variable (const struct varobj *var,
+                      enum varobj_display_formats format)
 {
   struct value_print_options opts;
 
   varobj_formatted_print_options (&opts, format);
 
-  return ada_varobj_get_value_of_variable (var->value, var->type, &opts);
+  return ada_varobj_get_value_of_variable (var->value.get (), var->type,
+                                          &opts);
 }
 
 /* Implement the "value_is_changeable_p" routine for Ada.  */
 
-static int
-ada_value_is_changeable_p (struct varobj *var)
+static bool
+ada_value_is_changeable_p (const struct varobj *var)
 {
-  struct type *type = var->value ? value_type (var->value) : var->type;
+  struct type *type = (var->value != nullptr
+                      ? value_type (var->value.get ()) : var->type);
 
-  if (ada_is_array_descriptor_type (type)
-      && TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
+  if (type->code () == TYPE_CODE_REF)
+    type = TYPE_TARGET_TYPE (type);
+
+  if (ada_is_access_to_unconstrained_array (type))
     {
       /* This is in reality a pointer to an unconstrained array.
         its value is changeable.  */
-      return 1;
+      return true;
     }
 
   if (ada_is_string_type (type))
@@ -969,7 +954,7 @@ ada_value_is_changeable_p (struct varobj *var)
       /* We display the contents of the string in the array's
         "value" field.  The contents can change, so consider
         that the array is changeable.  */
-      return 1;
+      return true;
     }
 
   return varobj_default_value_is_changeable_p (var);
@@ -977,11 +962,10 @@ ada_value_is_changeable_p (struct varobj *var)
 
 /* Implement the "value_has_mutated" routine for Ada.  */
 
-static int
-ada_value_has_mutated (struct varobj *var, struct value *new_val,
+static bool
+ada_value_has_mutated (const struct varobj *var, struct value *new_val,
                       struct type *new_type)
 {
-  int i;
   int from = -1;
   int to = -1;
 
@@ -989,7 +973,7 @@ ada_value_has_mutated (struct varobj *var, struct value *new_val,
      has mutated.  */
   if (ada_varobj_get_number_of_children (new_val, new_type)
       != var->num_children)
-    return 1;
+    return true;
 
   /* If the number of fields have remained the same, then we need
      to check the name of each field.  If they remain the same,
@@ -1005,13 +989,13 @@ ada_value_has_mutated (struct varobj *var, struct value *new_val,
      has mutated or not. So just assume it hasn't.  */
 
   varobj_restrict_range (var->children, &from, &to);
-  for (i = from; i < to; i++)
-    if (strcmp (ada_varobj_get_name_of_child (new_val, new_type,
-                                             var->name, i),
-               VEC_index (varobj_p, var->children, i)->name) != 0)
-      return 1;
+  for (int i = from; i < to; i++)
+    if (ada_varobj_get_name_of_child (new_val, new_type,
+                                     var->name.c_str (), i)
+       != var->children[i]->name)
+      return true;
 
-  return 0;
+  return false;
 }
 
 /* varobj operations for ada.  */
@@ -1026,5 +1010,6 @@ const struct lang_varobj_ops ada_varobj_ops =
   ada_type_of_child,
   ada_value_of_variable,
   ada_value_is_changeable_p,
-  ada_value_has_mutated
+  ada_value_has_mutated,
+  varobj_default_is_path_expr_parent
 };
This page took 0.046801 seconds and 4 git commands to generate.