--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
value;
/* Since one and only one language can apply, wrap the language specific
- information inside a union. */
+ information inside a union. */
union
{
- struct cplus_specific
+ /* This is used by languages which wish to store a demangled name.
+ currently used by Ada, Java, and Objective C.*/
+ struct mangled_lang
{
- /* This is in fact used for C++, Java, and Objective C. */
char *demangled_name;
}
- cplus_specific;
+ mangled_lang;
+
+ struct cplus_specific *cplus_specific;
}
language_specific;
short section;
- /* The section associated with this symbol. */
+ /* The section associated with this symbol. It can be NULL. */
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
SYMBOL argument being either a partial symbol, a minimal symbol or
a full symbol. All three types have a ginfo field. In particular
- the SYMBOL_INIT_LANGUAGE_SPECIFIC, SYMBOL_DEMANGLED_NAME, etc.
+ the SYMBOL_SET_LANGUAGE, SYMBOL_DEMANGLED_NAME, etc.
macros cannot be entirely substituted by
functions, unless the callers are changed to pass in the ginfo
field only, instead of the SYMBOL parameter. */
/* Initializes the language dependent portion of a symbol
depending upon the language for the symbol. */
-#define SYMBOL_INIT_LANGUAGE_SPECIFIC(symbol,language) \
- (symbol_init_language_specific (&(symbol)->ginfo, (language)))
-extern void symbol_init_language_specific (struct general_symbol_info *symbol,
- enum language language);
+#define SYMBOL_SET_LANGUAGE(symbol,language) \
+ (symbol_set_language (&(symbol)->ginfo, (language)))
+extern void symbol_set_language (struct general_symbol_info *symbol,
+ enum language language);
/* Set just the linkage name of a symbol; do not try to demangle
it. Used for constructs which do not have a mangled name,
STRUCT_DOMAIN,
- /* LABEL_DOMAIN may be used for names of labels (for gotos);
- currently it is not used and labels are not recorded at all. */
+ /* LABEL_DOMAIN may be used for names of labels (for gotos). */
LABEL_DOMAIN,
int (*read_needs_frame) (struct symbol * symbol);
/* Write to STREAM a natural-language description of the location of
- SYMBOL. */
- int (*describe_location) (struct symbol * symbol, struct ui_file * stream);
+ SYMBOL, in the context of ADDR. */
+ void (*describe_location) (struct symbol * symbol, CORE_ADDR addr,
+ struct ui_file * stream);
/* Tracepoint support. Append bytecodes to the tracepoint agent
expression AX that push the address of the object SYMBOL. Set
/* 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
#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
const struct block *block,
const domain_enum domain);
+/* Lookup a symbol only in the file static scope of all the objfiles. */
+
+struct symbol *lookup_static_symbol_aux (const char *name,
+ const domain_enum domain);
+
+
/* lookup a symbol by name, within a specified block */
extern struct symbol *lookup_block_symbol (const struct block *, const char *,
extern void reread_symbols (void);
+extern struct symbol *lookup_type_symbol (const char* name,
+ const struct block *block,
+ const domain_enum domain,
+ enum language lang);
extern struct type *lookup_transparent_type (const char *);
extern struct type *basic_lookup_transparent_type (const char *);
extern void select_source_symtab (struct symtab *);
+extern char **default_make_symbol_completion_list_break_on
+ (char *text, char *word, const char *break_on);
extern char **default_make_symbol_completion_list (char *, char *);
extern char **make_symbol_completion_list (char *, char *);
extern char **make_symbol_completion_list_fn (struct cmd_list_element *,
int matching_obj_sections (struct obj_section *, struct obj_section *);
-extern char *find_main_filename (void);
+extern const char *find_main_filename (void);
extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *);
-extern CORE_ADDR find_function_start_pc (struct gdbarch *,
- CORE_ADDR, struct obj_section *);
-
extern struct symtab_and_line find_function_start_sal (struct symbol *sym,
int);
+extern void skip_prologue_sal (struct symtab_and_line *);
+
/* symfile.c */
extern void clear_symtab_users (void);
-extern enum language deduce_language_from_filename (char *);
+extern enum language deduce_language_from_filename (const char *);
/* symtab.c */
const char *name,
const domain_enum domain);
-extern struct symtabs_and_lines
-expand_line_sal (struct symtab_and_line sal);
+extern struct symtabs_and_lines expand_line_sal (struct symtab_and_line sal);
+
+/* Return 1 if the supplied producer string matches the ARM RealView
+ compiler (armcc). */
+int producer_is_realview (const char *producer);
void fixup_section (struct general_symbol_info *ginfo,
CORE_ADDR addr, struct objfile *objfile);
+struct objfile *lookup_objfile_from_block (const struct block *block);
+
#endif /* !defined(SYMTAB_H) */