*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / symtab.h
index 30de42d241fad0af88b90b7e64ca6290f0814a9a..de6f1886b17eefa5c07e9f88bb8081aba0b4164d 100644 (file)
@@ -75,7 +75,12 @@ struct program_space;
 
    --chastain 2003-08-21  */
 
+/* Struct for storing C++ specific information.  Allocated when needed.  */
 
+struct cplus_specific
+{
+  char *demangled_name;
+};
 
 /* Define a structure for the information that is common to all symbol types,
    including minimal symbols, partial symbols, and full symbols.  In a
@@ -120,7 +125,7 @@ struct general_symbol_info
   value;
 
   /* Since one and only one language can apply, wrap the language specific
-     information inside a union. */
+     information inside a union.  */
 
   union
   {
@@ -131,6 +136,8 @@ struct general_symbol_info
       char *demangled_name;
     }
     mangled_lang;
+
+    struct cplus_specific *cplus_specific;
   }
   language_specific;
 
@@ -154,6 +161,11 @@ struct general_symbol_info
   struct obj_section *obj_section;
 };
 
+extern void symbol_set_demangled_name (struct general_symbol_info *, char *,
+                                       struct objfile *);
+
+extern char *symbol_get_demangled_name (const struct general_symbol_info *);
+
 extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
 
 /* Note that all the following SYMBOL_* macros are used with the
@@ -577,6 +589,10 @@ struct symbol
   /* Whether this is an inlined function (class LOC_BLOCK only).  */
   unsigned is_inlined : 1;
 
+  /* True if this is a C++ function symbol with template arguments.
+     In this case the symbol is really a "struct template_symbol".  */
+  unsigned is_cplus_template_function : 1;
+
   /* Line number of this symbol's definition, except for inlined
      functions.  For an inlined function (class LOC_BLOCK and
      SYMBOL_INLINED set) this is the line number of the function's call
@@ -624,12 +640,34 @@ struct symbol
 #define SYMBOL_CLASS(symbol)           (symbol)->aclass
 #define SYMBOL_IS_ARGUMENT(symbol)     (symbol)->is_argument
 #define SYMBOL_INLINED(symbol)         (symbol)->is_inlined
+#define SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION(symbol) \
+  (symbol)->is_cplus_template_function
 #define SYMBOL_TYPE(symbol)            (symbol)->type
 #define SYMBOL_LINE(symbol)            (symbol)->line
 #define SYMBOL_SYMTAB(symbol)          (symbol)->symtab
 #define SYMBOL_COMPUTED_OPS(symbol)     (symbol)->ops.ops_computed
 #define SYMBOL_REGISTER_OPS(symbol)     (symbol)->ops.ops_register
 #define SYMBOL_LOCATION_BATON(symbol)   (symbol)->aux_value
+
+/* An instance of this type is used to represent a C++ template
+   function.  It includes a "struct symbol" as a kind of base class;
+   users downcast to "struct template_symbol *" when needed.  A symbol
+   is really of this type iff SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION is
+   true.  */
+
+struct template_symbol
+{
+  /* The base class.  */
+  struct symbol base;
+
+  /* The number of template arguments.  */
+  int n_template_arguments;
+
+  /* The template arguments.  This is an array with
+     N_TEMPLATE_ARGUMENTS elements.  */
+  struct symbol **template_arguments;
+};
+
 \f
 /* Each item represents a line-->pc (or the reverse) mapping.  This is
    somewhat more wasteful of space than one might wish, but since only
This page took 0.024861 seconds and 4 git commands to generate.