aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/varobj.c85
-rw-r--r--gdb/varobj.h2
3 files changed, 96 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 565fba7..780414b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
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. */
diff --git a/gdb/varobj.h b/gdb/varobj.h
index ef984c8..7bf87d9 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -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). */