gdbsupport: re-indent ptrace.m4
[deliverable/binutils-gdb.git] / gdb / c-lang.c
index eb987f4dd25337a80f521e3c1103c15dbfcb82c0..329986ce88c737121d7d4d95cf7bc768f977dd42 100644 (file)
@@ -871,36 +871,13 @@ 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 =
-{
-  language_c,
-  range_check_off,
-  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 */
-  1,                           /* c-style arrays */
-  0,                           /* String lower bound */
-  &c_varobj_ops,
-};
-
 /* Class representing the C language.  */
 
 class c_language : public language_defn
 {
 public:
   c_language ()
-    : language_defn (language_c, c_language_data)
+    : language_defn (language_c)
   { /* Nothing.  */ }
 
   /* See language.h.  */
@@ -913,6 +890,14 @@ public:
   const char *natural_name () const override
   { 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
@@ -944,6 +929,26 @@ public:
   {
     c_print_type (type, varstring, stream, show, level, flags);
   }
+
+  /* See language.h.  */
+
+  bool store_sym_names_in_linkage_form_p () const override
+  { return true; }
+
+  /* See language.h.  */
+
+  enum macro_expansion macro_expansion () const override
+  { return macro_expansion_c; }
+
+  /* See language.h.  */
+
+  const struct exp_descriptor *expression_ops () const override
+  { return &exp_descriptor_c; }
+
+  /* See language.h.  */
+
+  const struct op_print *opcode_print_table () const override
+  { return c_op_print_tab; }
 };
 
 /* Single instance of the C language class.  */
@@ -978,36 +983,13 @@ 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 =
-{
-  language_cplus,
-  range_check_off,
-  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 */
-  1,                           /* c-style arrays */
-  0,                           /* String lower bound */
-  &cplus_varobj_ops,
-};
-
 /* A class for the C++ language.  */
 
 class cplus_language : public language_defn
 {
 public:
   cplus_language ()
-    : language_defn (language_cplus, cplus_language_data)
+    : language_defn (language_cplus)
   { /* Nothing.  */ }
 
   /* See language.h.  */
@@ -1022,6 +1004,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
   {
@@ -1129,7 +1120,7 @@ public:
 
   /* See language.h.  */
 
-  char *demangle (const char *mangled, int options) const override
+  char *demangle_symbol (const char *mangled, int options) const override
   {
     return gdb_demangle (mangled, options);
   }
@@ -1172,6 +1163,26 @@ public:
   const char *name_of_this () const override
   { return "this"; }
 
+  /* See language.h.  */
+
+  enum macro_expansion macro_expansion () const override
+  { return macro_expansion_c; }
+
+  /* See language.h.  */
+
+  const struct lang_varobj_ops *varobj_ops () const override
+  { return &cplus_varobj_ops; }
+
+  /* See language.h.  */
+
+  const struct exp_descriptor *expression_ops () const override
+  { return &exp_descriptor_c; }
+
+  /* See language.h.  */
+
+  const struct op_print *opcode_print_table () const override
+  { return c_op_print_tab; }
+
 protected:
 
   /* See language.h.  */
@@ -1187,36 +1198,13 @@ 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 =
-{
-  language_asm,
-  range_check_off,
-  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 */
-  1,                           /* c-style arrays */
-  0,                           /* String lower bound */
-  &default_varobj_ops,
-};
-
 /* A class for the ASM language.  */
 
 class asm_language : public language_defn
 {
 public:
   asm_language ()
-    : language_defn (language_asm, asm_language_data)
+    : language_defn (language_asm)
   { /* Nothing.  */ }
 
   /* See language.h.  */
@@ -1229,6 +1217,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?  */
@@ -1246,39 +1243,41 @@ public:
   {
     c_print_type (type, varstring, stream, show, level, flags);
   }
+
+  /* See language.h.  */
+
+  bool store_sym_names_in_linkage_form_p () const override
+  { return true; }
+
+  /* See language.h.  */
+
+  enum macro_expansion macro_expansion () const override
+  { return macro_expansion_c; }
+
+  /* See language.h.  */
+
+  const struct exp_descriptor *expression_ops () const override
+  { return &exp_descriptor_c; }
+
+  /* See language.h.  */
+
+  const struct op_print *opcode_print_table () const override
+  { return c_op_print_tab; }
 };
 
 /* The single instance of the ASM language class.  */
 static asm_language asm_language_defn;
 
-/* The following language_defn does not represent a real language.
-   It just provides a minimal support a-la-C that should allow users
-   to do some simple operations when debugging applications that use
+/* A class for the minimal language.  This does not represent a real
+   language.  It just provides a minimal support a-la-C that should allow
+   users to do some simple operations when debugging applications that use
    a language currently not supported by GDB.  */
 
-extern const struct language_data minimal_language_data =
-{
-  language_minimal,
-  range_check_off,
-  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 */
-  1,                           /* c-style arrays */
-  0,                           /* String lower bound */
-  &default_varobj_ops,
-};
-
-/* A class for the minimal language.  */
-
 class minimal_language : public language_defn
 {
 public:
   minimal_language ()
-    : language_defn (language_minimal, minimal_language_data)
+    : language_defn (language_minimal)
   { /* Nothing.  */ }
 
   /* See language.h.  */
@@ -1306,6 +1305,26 @@ public:
   {
     c_print_type (type, varstring, stream, show, level, flags);
   }
+
+  /* See language.h.  */
+
+  bool store_sym_names_in_linkage_form_p () const override
+  { return true; }
+
+  /* See language.h.  */
+
+  enum macro_expansion macro_expansion () const override
+  { return macro_expansion_c; }
+
+  /* See language.h.  */
+
+  const struct exp_descriptor *expression_ops () const override
+  { return &exp_descriptor_c; }
+
+  /* See language.h.  */
+
+  const struct op_print *opcode_print_table () const override
+  { return c_op_print_tab; }
 };
 
 /* The single instance of the minimal language class.  */
This page took 0.027579 seconds and 4 git commands to generate.