/* C language support routines for GDB, the GNU debugger.
- Copyright (C) 1992-2015 Free Software Foundation, Inc.
+ Copyright (C) 1992-2017 Free Software Foundation, Inc.
This file is part of GDB.
error:
{
- char *type_str;
-
- type_str = type_to_string (type);
- if (type_str)
+ std::string type_str = type_to_string (type);
+ if (!type_str.empty ())
{
- make_cleanup (xfree, type_str);
error (_("Trying to read string with inappropriate type `%s'."),
- type_str);
+ type_str.c_str ());
}
else
error (_("Trying to read string with inappropriate type."));
obstack_object_size (&output));
}
else
- result = value_cstring (obstack_base (&output),
+ result = value_cstring ((const char *) obstack_base (&output),
obstack_object_size (&output),
type);
}
evaluate_subexp_c
};
+static const char *c_extensions[] =
+{
+ ".c", NULL
+};
+
const struct language_defn c_language_defn =
{
"c", /* Language name */
case_sensitive_on,
array_row_major,
macro_expansion_c,
+ c_extensions,
&exp_descriptor_c,
c_parse,
- c_error,
+ c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
+ NULL,
NULL, /* Language specific
class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
cplus_primitive_type_decfloat,
cplus_primitive_type_decdouble,
cplus_primitive_type_declong,
+ cplus_primitive_type_char16_t,
+ cplus_primitive_type_char32_t,
nr_cplus_primitive_types
};
= builtin->builtin_decdouble;
lai->primitive_type_vector [cplus_primitive_type_declong]
= builtin->builtin_declong;
+ lai->primitive_type_vector [cplus_primitive_type_char16_t]
+ = builtin->builtin_char16;
+ lai->primitive_type_vector [cplus_primitive_type_char32_t]
+ = builtin->builtin_char32;
lai->bool_type_symbol = "bool";
lai->bool_type_default = builtin->builtin_bool;
}
+static const char *cplus_extensions[] =
+{
+ ".C", ".cc", ".cp", ".cpp", ".cxx", ".c++", NULL
+};
+
const struct language_defn cplus_language_defn =
{
"c++", /* Language name */
case_sensitive_on,
array_row_major,
macro_expansion_c,
+ cplus_extensions,
&exp_descriptor_c,
c_parse,
- c_error,
+ c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
cp_lookup_transparent_type, /* lookup_transparent_type */
gdb_demangle, /* Language specific symbol demangler */
+ gdb_sniff_from_mangled_name,
cp_class_name_from_physname, /* Language specific
class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
LANG_MAGIC
};
+static const char *asm_extensions[] =
+{
+ ".s", ".sx", ".S", NULL
+};
+
const struct language_defn asm_language_defn =
{
"asm", /* Language name */
case_sensitive_on,
array_row_major,
macro_expansion_c,
+ asm_extensions,
&exp_descriptor_c,
c_parse,
- c_error,
+ c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
+ NULL,
NULL, /* Language specific
class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
case_sensitive_on,
array_row_major,
macro_expansion_c,
+ NULL,
&exp_descriptor_c,
c_parse,
- c_error,
+ c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
+ NULL,
NULL, /* Language specific
class_name_from_physname */
c_op_print_tab, /* expression operators for printing */