From 40591b7d6426f9d64162fa372a6d2a161cbe837a Mon Sep 17 00:00:00 2001 From: Jean-Charles Delay Date: Mon, 18 Jul 2011 09:21:43 +0000 Subject: 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. --- gdb/varobj.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) (limited to 'gdb/varobj.c') 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. */ -- cgit v1.1