/* 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.
#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);
static void unk_lang_error (char *);
-static int unk_lang_parser (void);
+static int unk_lang_parser (struct parser_state *);
static void show_check (char *, int);
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 *);
}
/* Return the language as a string. */
-char *
+const char *
language_str (enum language lang)
{
int i;
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;
/* Define the language that is no language. */
static int
-unk_lang_parser (void)
+unk_lang_parser (struct parser_state *ps)
{
return 1;
}
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."));
/* 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)
const struct language_defn unknown_language_defn =
{
"unknown",
+ "Unknown",
language_unknown,
range_check_off,
case_sensitive_on,
default_get_string,
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
+ &default_varobj_ops,
LANG_MAGIC
};
const struct language_defn auto_language_defn =
{
"auto",
+ "Auto",
language_auto,
range_check_off,
case_sensitive_on,
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,
default_get_string,
NULL, /* la_get_symbol_name_cmp */
iterate_over_symbols,
+ &default_varobj_ops,
LANG_MAGIC
};
\f