don't let bin2hex call strlen
[deliverable/binutils-gdb.git] / gdb / language.c
index 841f2d633ba2de801e6633183dbc20e2ba0ffcb5..ae0fa15f6eda557e53eebe3d7811f5f8fa5b70d7 100644 (file)
@@ -1,7 +1,6 @@
 /* Multiple source language support for GDB.
 
-   Copyright (C) 1991-1996, 1998-2005, 2007-2012 Free Software
-   Foundation, Inc.
+   Copyright (C) 1991-2014 Free Software Foundation, Inc.
 
    Contributed by the Department of Computer Science at the State University
    of New York at Buffalo.
@@ -31,7 +30,7 @@
 
 #include "defs.h"
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "gdbcmd.h"
 #include "expression.h"
 #include "language.h"
+#include "varobj.h"
 #include "target.h"
 #include "parser-defs.h"
 #include "jv-lang.h"
 #include "demangle.h"
 #include "symfile.h"
+#include "cp-support.h"
 
 extern void _initialize_language (void);
 
@@ -63,9 +64,6 @@ static void unk_lang_emit_char (int c, struct type *type,
 static void unk_lang_printchar (int c, struct type *type,
                                struct ui_file *stream);
 
-static void unk_lang_print_type (struct type *, const char *, struct ui_file *,
-                                int, int);
-
 static void unk_lang_value_print (struct value *, struct ui_file *,
                                  const struct value_print_options *);
 
@@ -487,7 +485,7 @@ language_def (enum language lang)
 }
 
 /* Return the language as a string.  */
-char *
+const char *
 language_str (enum language lang)
 {
   int i;
@@ -522,7 +520,7 @@ void
 add_language (const struct language_defn *lang)
 {
   /* For the "set language" command.  */
-  static char **language_names = NULL;
+  static const char **language_names = NULL;
   /* For the "help set language" command.  */
   char *language_set_doc = NULL;
 
@@ -734,7 +732,8 @@ unk_lang_printstr (struct ui_file *stream, struct type *type,
 
 static void
 unk_lang_print_type (struct type *type, const char *varstring,
-                    struct ui_file *stream, int show, int level)
+                    struct ui_file *stream, int show, int level,
+                    const struct type_print_options *flags)
 {
   error (_("internal error - unimplemented "
           "function unk_lang_print_type called."));
@@ -767,7 +766,7 @@ static CORE_ADDR unk_lang_trampoline (struct frame_info *frame, CORE_ADDR pc)
 /* Unknown languages just use the cplus demangler.  */
 static char *unk_lang_demangle (const char *mangled, int options)
 {
-  return cplus_demangle (mangled, options);
+  return gdb_demangle (mangled, options);
 }
 
 static char *unk_lang_class_name (const char *mangled)
@@ -793,6 +792,7 @@ unknown_language_arch_info (struct gdbarch *gdbarch,
 const struct language_defn unknown_language_defn =
 {
   "unknown",
+  "Unknown",
   language_unknown,
   range_check_off,
   case_sensitive_on,
@@ -828,6 +828,7 @@ const struct language_defn unknown_language_defn =
   default_get_string,
   NULL,                                /* la_get_symbol_name_cmp */
   iterate_over_symbols,
+  &default_varobj_ops,
   LANG_MAGIC
 };
 
@@ -836,6 +837,7 @@ const struct language_defn unknown_language_defn =
 const struct language_defn auto_language_defn =
 {
   "auto",
+  "Auto",
   language_auto,
   range_check_off,
   case_sensitive_on,
@@ -871,12 +873,14 @@ const struct language_defn auto_language_defn =
   default_get_string,
   NULL,                                /* la_get_symbol_name_cmp */
   iterate_over_symbols,
+  &default_varobj_ops,
   LANG_MAGIC
 };
 
 const struct language_defn local_language_defn =
 {
   "local",
+  "Local",
   language_auto,
   range_check_off,
   case_sensitive_on,
@@ -912,6 +916,7 @@ const struct language_defn local_language_defn =
   default_get_string,
   NULL,                                /* la_get_symbol_name_cmp */
   iterate_over_symbols,
+  &default_varobj_ops,
   LANG_MAGIC
 };
 \f
This page took 0.025966 seconds and 4 git commands to generate.