aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorJean-Charles Delay <jcd@sourceware.org>2011-07-18 09:21:43 +0000
committerJean-Charles Delay <jcd@sourceware.org>2011-07-18 09:21:43 +0000
commit40591b7d6426f9d64162fa372a6d2a161cbe837a (patch)
treefc13d4ab298de7a8806ea6106902c70e1105466f /gdb/varobj.c
parentd5b4a7be2c2c884a4e2d752c1055efd164bc8067 (diff)
downloadgdb-40591b7d6426f9d64162fa372a6d2a161cbe837a.zip
gdb-40591b7d6426f9d64162fa372a6d2a161cbe837a.tar.gz
gdb-40591b7d6426f9d64162fa372a6d2a161cbe837a.tar.bz2
gdb/
* 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.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c85
1 files changed, 84 insertions, 1 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 4f8ded7..2014559 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -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. */