X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fc-lang.c;h=41eac2d43a3c83bdd77aa79346ef1931e13c6bc4;hb=67bd3fd5e4d1bf9f1730eaf6ed9fa9df89904fc2;hp=37e69d433f0d782f779150f02ac3623031b915ff;hpb=87afa6523b01cd6bdcc3903fe22953966cec7bb7;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 37e69d433f..41eac2d43a 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -871,37 +871,19 @@ const struct exp_descriptor exp_descriptor_c = evaluate_subexp_c }; -static const char *c_extensions[] = -{ - ".c", NULL -}; - /* Constant data that describes the C language. */ extern const struct language_data c_language_data = { - "c", /* Language name */ - "C", - language_c, range_check_off, case_sensitive_on, array_row_major, macro_expansion_c, - c_extensions, &exp_descriptor_c, - null_post_parser, - c_printchar, /* Print a character constant */ - c_printstr, /* Function to print string constant */ - c_emit_char, /* Print a single char */ - c_print_typedef, /* Print a typedef using appropriate syntax */ - NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ c_op_print_tab, /* expression operators for printing */ - 1, /* c-style arrays */ 0, /* String lower bound */ &c_varobj_ops, - c_is_string_type_p, - "{...}" /* la_struct_too_deep_ellipsis */ }; /* Class representing the C language. */ @@ -913,6 +895,24 @@ public: : language_defn (language_c, c_language_data) { /* Nothing. */ } + /* See language.h. */ + + const char *name () const override + { return "c"; } + + /* See language.h. */ + + const char *natural_name () const override + { return "C"; } + + /* See language.h. */ + + const std::vector &filename_extensions () const override + { + static const std::vector extensions = { ".c" }; + return extensions; + } + /* See language.h. */ void language_arch_info (struct gdbarch *gdbarch, struct language_arch_info *lai) const override @@ -978,37 +978,19 @@ enum cplus_primitive_types { nr_cplus_primitive_types }; -static const char *cplus_extensions[] = -{ - ".C", ".cc", ".cp", ".cpp", ".cxx", ".c++", NULL -}; - /* Constant data that describes the C++ language. */ extern const struct language_data cplus_language_data = { - "c++", /* Language name */ - "C++", - language_cplus, range_check_off, case_sensitive_on, array_row_major, macro_expansion_c, - cplus_extensions, &exp_descriptor_c, - null_post_parser, - c_printchar, /* Print a character constant */ - c_printstr, /* Function to print string constant */ - c_emit_char, /* Print a single char */ - c_print_typedef, /* Print a typedef using appropriate syntax */ - "this", /* name_of_this */ false, /* la_store_sym_names_in_linkage_form_p */ c_op_print_tab, /* expression operators for printing */ - 1, /* c-style arrays */ 0, /* String lower bound */ &cplus_varobj_ops, - c_is_string_type_p, - "{...}" /* la_struct_too_deep_ellipsis */ }; /* A class for the C++ language. */ @@ -1022,6 +1004,25 @@ public: /* See language.h. */ + const char *name () const override + { return "c++"; } + + /* See language.h. */ + + const char *natural_name () const override + { return "C++"; } + + /* See language.h. */ + + const std::vector &filename_extensions () const override + { + static const std::vector extensions + = { ".C", ".cc", ".cp", ".cpp", ".cxx", ".c++" }; + return extensions; + } + + /* See language.h. */ + struct language_pass_by_ref_info pass_by_reference_info (struct type *type) const override { @@ -1167,6 +1168,11 @@ public: return cp_lookup_symbol_nonlocal (this, name, block, domain); } + /* See language.h. */ + + const char *name_of_this () const override + { return "this"; } + protected: /* See language.h. */ @@ -1182,37 +1188,19 @@ protected: static cplus_language cplus_language_defn; -static const char *asm_extensions[] = -{ - ".s", ".sx", ".S", NULL -}; - /* Constant data that describes the ASM language. */ extern const struct language_data asm_language_data = { - "asm", /* Language name */ - "assembly", - language_asm, range_check_off, case_sensitive_on, array_row_major, macro_expansion_c, - asm_extensions, &exp_descriptor_c, - null_post_parser, - c_printchar, /* Print a character constant */ - c_printstr, /* Function to print string constant */ - c_emit_char, /* Print a single char */ - c_print_typedef, /* Print a typedef using appropriate syntax */ - NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ c_op_print_tab, /* expression operators for printing */ - 1, /* c-style arrays */ 0, /* String lower bound */ &default_varobj_ops, - c_is_string_type_p, - "{...}" /* la_struct_too_deep_ellipsis */ }; /* A class for the ASM language. */ @@ -1224,6 +1212,25 @@ public: : language_defn (language_asm, asm_language_data) { /* Nothing. */ } + /* See language.h. */ + + const char *name () const override + { return "asm"; } + + /* See language.h. */ + + const char *natural_name () const override + { return "Assembly"; } + + /* See language.h. */ + + const std::vector &filename_extensions () const override + { + static const std::vector extensions + = { ".s", ".sx", ".S" }; + return extensions; + } + /* See language.h. FIXME: Should this have its own arch info method? */ @@ -1253,28 +1260,15 @@ static asm_language asm_language_defn; extern const struct language_data minimal_language_data = { - "minimal", /* Language name */ - "Minimal", - language_minimal, range_check_off, case_sensitive_on, array_row_major, macro_expansion_c, - NULL, &exp_descriptor_c, - null_post_parser, - c_printchar, /* Print a character constant */ - c_printstr, /* Function to print string constant */ - c_emit_char, /* Print a single char */ - c_print_typedef, /* Print a typedef using appropriate syntax */ - NULL, /* name_of_this */ true, /* la_store_sym_names_in_linkage_form_p */ c_op_print_tab, /* expression operators for printing */ - 1, /* c-style arrays */ 0, /* String lower bound */ &default_varobj_ops, - c_is_string_type_p, - "{...}" /* la_struct_too_deep_ellipsis */ }; /* A class for the minimal language. */ @@ -1286,6 +1280,16 @@ public: : language_defn (language_minimal, minimal_language_data) { /* Nothing. */ } + /* See language.h. */ + + const char *name () const override + { return "minimal"; } + + /* See language.h. */ + + const char *natural_name () const override + { return "Minimal"; } + /* See language.h. */ void language_arch_info (struct gdbarch *gdbarch, struct language_arch_info *lai) const override