daily update
[binutils-gdb.git] / gdb / varobj.c
index b5cf17da2aaf392c2ecff8cdc4090ca3e683acc4..bbe42137a1b3fbfaeabfbd3228d858c09c4bbd53 100644 (file)
@@ -1,6 +1,6 @@
 /* Implementation of the GDB variable objects API.
 
-   Copyright (C) 1999-2013 Free Software Foundation, Inc.
+   Copyright (C) 1999-2014 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
 #include "valprint.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_regex.h"
 
 #include "varobj.h"
@@ -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.  */
@@ -1059,7 +1046,7 @@ varobj_add_child (struct varobj *var, char *name, struct value *value)
 char *
 varobj_get_type (struct varobj *var)
 {
-  /* For the "fake" variables, do not return a type.  (It's type is
+  /* For the "fake" variables, do not return a type.  (Its type is
      NULL, too.)
      Do not return a type for invalid variables as well.  */
   if (CPLUS_FAKE_CHILD (var) || !var->root->is_valid)
@@ -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