aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index eb987f4..ce4620a 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -871,11 +871,6 @@ const struct exp_descriptor exp_descriptor_c =
evaluate_subexp_c
};
-static const char * const c_extensions[] =
-{
- ".c", NULL
-};
-
/* Constant data that describes the C language. */
extern const struct language_data c_language_data =
@@ -885,7 +880,6 @@ extern const struct language_data c_language_data =
case_sensitive_on,
array_row_major,
macro_expansion_c,
- c_extensions,
&exp_descriptor_c,
true, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */
@@ -914,6 +908,14 @@ public:
{ return "C"; }
/* See language.h. */
+
+ const std::vector<const char *> &filename_extensions () const override
+ {
+ static const std::vector<const char *> extensions = { ".c" };
+ return extensions;
+ }
+
+ /* See language.h. */
void language_arch_info (struct gdbarch *gdbarch,
struct language_arch_info *lai) const override
{
@@ -978,11 +980,6 @@ enum cplus_primitive_types {
nr_cplus_primitive_types
};
-static const char * const cplus_extensions[] =
-{
- ".C", ".cc", ".cp", ".cpp", ".cxx", ".c++", NULL
-};
-
/* Constant data that describes the C++ language. */
extern const struct language_data cplus_language_data =
@@ -992,7 +989,6 @@ extern const struct language_data cplus_language_data =
case_sensitive_on,
array_row_major,
macro_expansion_c,
- cplus_extensions,
&exp_descriptor_c,
false, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */
@@ -1022,6 +1018,15 @@ public:
/* See language.h. */
+ const std::vector<const char *> &filename_extensions () const override
+ {
+ static const std::vector<const char *> 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
{
@@ -1187,11 +1192,6 @@ protected:
static cplus_language cplus_language_defn;
-static const char * const asm_extensions[] =
-{
- ".s", ".sx", ".S", NULL
-};
-
/* Constant data that describes the ASM language. */
extern const struct language_data asm_language_data =
@@ -1201,7 +1201,6 @@ extern const struct language_data asm_language_data =
case_sensitive_on,
array_row_major,
macro_expansion_c,
- asm_extensions,
&exp_descriptor_c,
true, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */
@@ -1229,6 +1228,15 @@ public:
const char *natural_name () const override
{ return "Assembly"; }
+ /* See language.h. */
+
+ const std::vector<const char *> &filename_extensions () const override
+ {
+ static const std::vector<const char *> extensions
+ = { ".s", ".sx", ".S" };
+ return extensions;
+ }
+
/* See language.h.
FIXME: Should this have its own arch info method? */
@@ -1263,7 +1271,6 @@ extern const struct language_data minimal_language_data =
case_sensitive_on,
array_row_major,
macro_expansion_c,
- NULL,
&exp_descriptor_c,
true, /* la_store_sym_names_in_linkage_form_p */
c_op_print_tab, /* expression operators for printing */