aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
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/mi
parent6abde28fa9f6f14e03e3d9414da6423843d5e5c4 (diff)
downloadgdb-fa4d0c4081f7337c0126a01f16959f7a4e864ff5.zip
gdb-fa4d0c4081f7337c0126a01f16959f7a4e864ff5.tar.gz
gdb-fa4d0c4081f7337c0126a01f16959f7a4e864ff5.tar.bz2
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/mi')
-rw-r--r--gdb/mi/mi-cmd-var.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 57a2f6b..0a2ef5c 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -24,6 +24,7 @@
#include "ui-out.h"
#include "mi-out.h"
#include "varobj.h"
+#include "language.h"
#include "value.h"
#include <ctype.h>
#include "gdb_string.h"
@@ -479,7 +480,7 @@ void
mi_cmd_var_info_expression (char *command, char **argv, int argc)
{
struct ui_out *uiout = current_uiout;
- enum varobj_languages lang;
+ const struct language_defn *lang;
struct varobj *var;
if (argc != 1)
@@ -490,7 +491,7 @@ mi_cmd_var_info_expression (char *command, char **argv, int argc)
lang = varobj_get_language (var);
- ui_out_field_string (uiout, "lang", varobj_language_string[(int) lang]);
+ ui_out_field_string (uiout, "lang", lang->la_natural_name);
ui_out_field_string (uiout, "exp", varobj_get_expression (var));
}