summaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-10-09 22:10:14 +0800
committerYao Qi <yao@codesourcery.com>2013-11-07 15:10:50 +0800
commitfa4d0c4081f7337c0126a01f16959f7a4e864ff5 (patch)
treeeaf1a0c7fcca5c4221121306c849be076763b412 /gdb/varobj.c
parent6abde28fa9f6f14e03e3d9414da6423843d5e5c4 (diff)
downloadbinutils-gdb-fa4d0c4081f7337c0126a01f16959f7a4e864ff5.tar.gz
Remove varobj_language_string, languages and varobj_languages
This patch does some cleanups, removing some language-related stuff. Note that mi_cmd_var_info_expression uses varobj_language_string, which is redundant, because we can get language name from lang->la_natural_name. varobj_language_string doesn't have "Ada", which looks like a bug to me. With this patch applied, this problem doesn't exist, because the language name is got from the same place (field la_natural_name). gdb: 2013-11-07 Yao Qi <yao@codesourcery.com> * mi/mi-cmd-var.c: Include "language.h". (mi_cmd_var_info_expression): Get language name from language_defn. * varobj.c (varobj_language_string): Remove. (variable_language): Remove declaration. (languages): Remove. (varobj_get_language): Change the type of return value. (variable_language): Remove. * varobj.h (enum varobj_languages): Remove. (varobj_language_string): Remove declaration. (varobj_get_language): Update declaration. gdb/doc: 2013-11-07 Yao Qi <yao@codesourcery.com> * gdb.texinfo (GDB/MI Variable Objects): Update doc about the output of "-var-info-expression".
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index b5cf17da2aa..f15c9de7ce7 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -55,9 +55,6 @@ show_varobjdebug (struct ui_file *file, int from_tty,
char *varobj_format_string[] =
{ "natural", "binary", "decimal", "hexadecimal", "octal" };
-/* String representations of gdb's known languages. */
-char *varobj_language_string[] = { "C", "C++", "Java" };
-
/* True if we want to allow Python-based pretty-printing. */
static int pretty_printing = 0;
@@ -199,8 +196,6 @@ static int install_new_value (struct varobj *var, struct value *value,
/* Language-specific routines. */
-static enum varobj_languages variable_language (struct varobj *var);
-
static int number_of_children (struct varobj *);
static char *name_of_variable (struct varobj *);
@@ -224,14 +219,6 @@ static struct varobj *varobj_add_child (struct varobj *var,
#endif /* HAVE_PYTHON */
-/* Array of known source language routines. */
-static const struct lang_varobj_ops *languages[vlang_end] = {
- &c_varobj_ops,
- &cplus_varobj_ops,
- &java_varobj_ops,
- &ada_varobj_ops,
-};
-
/* Private data */
/* Mappings of varobj_display_formats enums to gdb's format codes. */
@@ -1126,10 +1113,10 @@ varobj_get_path_expr (struct varobj *var)
}
}
-enum varobj_languages
+const struct language_defn *
varobj_get_language (struct varobj *var)
{
- return variable_language (var);
+ return var->root->exp->language_defn;
}
int
@@ -2332,32 +2319,6 @@ cppop (struct cpstack **pstack)
/* Common entry points */
-/* Get the language of variable VAR. */
-static enum varobj_languages
-variable_language (struct varobj *var)
-{
- enum varobj_languages lang;
-
- switch (var->root->exp->language_defn->la_language)
- {
- default:
- case language_c:
- lang = vlang_c;
- break;
- case language_cplus:
- lang = vlang_cplus;
- break;
- case language_java:
- lang = vlang_java;
- break;
- case language_ada:
- lang = vlang_ada;
- break;
- }
-
- return lang;
-}
-
/* Return the number of children for a given variable.
The result of this function is defined by the language
implementation. The number of children returned by this function