gdb/
authorJean-Charles Delay <jcd@sourceware.org>
Mon, 18 Jul 2011 09:21:43 +0000 (09:21 +0000)
committerJean-Charles Delay <jcd@sourceware.org>
Mon, 18 Jul 2011 09:21:43 +0000 (09:21 +0000)
* varobj.h (varobj_languages): Add vlang_ada definition to the list
of supported languages.
* varobj.c: Add top definitions and basic implementation of the
following callbacks: ada_number_of_children, ada_name_of_variable,
ada_name_of_child, ada_path_expr_of_child, ada_value_of_root,
ada_value_of_child, ada_type_of_child, ada_value_of_variable.
(languages): Register Ada-specific callbacks.
(variable_language): Add the Ada case in the language setter switch.

gdb/ChangeLog
gdb/varobj.c
gdb/varobj.h

index 565fba7d63943811209cdcc0a67e1295e8dbbf06..780414b55fb4a5b08a35057e6a7169f62a11b23f 100644 (file)
@@ -1,3 +1,14 @@
+2011-07-18  Jean-Charles Delay  <delay@adacore.com>
+
+       * varobj.h (varobj_languages): Add vlang_ada definition to the list
+       of supported languages.
+       * varobj.c: Add top definitions and basic implementation of the
+       following callbacks: ada_number_of_children, ada_name_of_variable,
+       ada_name_of_child, ada_path_expr_of_child, ada_value_of_root,
+       ada_value_of_child, ada_type_of_child, ada_value_of_variable.
+       (languages): Register Ada-specific callbacks.
+       (variable_language): Add the Ada case in the language setter switch.
+
 2011-07-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * remote-mips.c (pmon_download): Fix ignored return value GCC warning.
index 4f8ded71dc6c5ad60670ad282ceb3006b9eb0d05..20145599ccda0d9b5b0cabd6e437ccbbb0aa3f1b 100644 (file)
@@ -361,6 +361,25 @@ static struct type *java_type_of_child (struct varobj *parent, int index);
 static char *java_value_of_variable (struct varobj *var,
                                     enum varobj_display_formats format);
 
+/* Ada implementation */
+
+static int ada_number_of_children (struct varobj *var);
+
+static char *ada_name_of_variable (struct varobj *parent);
+
+static char *ada_name_of_child (struct varobj *parent, int index);
+
+static char *ada_path_expr_of_child (struct varobj *child);
+
+static struct value *ada_value_of_root (struct varobj **var_handle);
+
+static struct value *ada_value_of_child (struct varobj *parent, int index);
+
+static struct type *ada_type_of_child (struct varobj *parent, int index);
+
+static char *ada_value_of_variable (struct varobj *var,
+                                   enum varobj_display_formats format);
+
 /* The language specific vector */
 
 struct language_specific
@@ -444,7 +463,18 @@ static struct language_specific languages[vlang_end] = {
    java_value_of_root,
    java_value_of_child,
    java_type_of_child,
-   java_value_of_variable}
+   java_value_of_variable},
+  /* Ada */
+  {
+   vlang_ada,
+   ada_number_of_children,
+   ada_name_of_variable,
+   ada_name_of_child,
+   ada_path_expr_of_child,
+   ada_value_of_root,
+   ada_value_of_child,
+   ada_type_of_child,
+   ada_value_of_variable}
 };
 
 /* A little convenience enum for dealing with C++/Java.  */
@@ -2402,6 +2432,9 @@ variable_language (struct varobj *var)
     case language_java:
       lang = vlang_java;
       break;
+    case language_ada:
+      lang = vlang_ada;
+      break;
     }
 
   return lang;
@@ -3585,6 +3618,56 @@ java_value_of_variable (struct varobj *var, enum varobj_display_formats format)
   return cplus_value_of_variable (var, format);
 }
 
+/* Ada specific callbacks for VAROBJs.  */
+
+static int
+ada_number_of_children (struct varobj *var)
+{
+  return c_number_of_children (var);
+}
+
+static char *
+ada_name_of_variable (struct varobj *parent)
+{
+  return c_name_of_variable (parent);
+}
+
+static char *
+ada_name_of_child (struct varobj *parent, int index)
+{
+  return c_name_of_child (parent, index);
+}
+
+static char*
+ada_path_expr_of_child (struct varobj *child)
+{
+  return c_path_expr_of_child (child);
+}
+
+static struct value *
+ada_value_of_root (struct varobj **var_handle)
+{
+  return c_value_of_root (var_handle);
+}
+
+static struct value *
+ada_value_of_child (struct varobj *parent, int index)
+{
+  return c_value_of_child (parent, index);
+}
+
+static struct type *
+ada_type_of_child (struct varobj *parent, int index)
+{
+  return c_type_of_child (parent, index);
+}
+
+static char *
+ada_value_of_variable (struct varobj *var, enum varobj_display_formats format)
+{
+  return c_value_of_variable (var, format);
+}
+
 /* Iterate all the existing _root_ VAROBJs and call the FUNC callback for them
    with an arbitrary caller supplied DATA pointer.  */
 
index ef984c8cb992646e8acce5b635f9771222f4d0c9..7bf87d99ac0e4b0cfa3b3fa0b05d2e334f2d08e6 100644 (file)
@@ -56,7 +56,7 @@ extern char *varobj_format_string[];
 /* Languages supported by this variable objects system.  */
 enum varobj_languages
   {
-    vlang_unknown = 0, vlang_c, vlang_cplus, vlang_java, vlang_end
+    vlang_unknown = 0, vlang_c, vlang_cplus, vlang_java, vlang_ada, vlang_end
   };
 
 /* String representations of gdb's known languages (defined in varobj.c).  */