/* Symbol table definitions for GDB.
- Copyright (C) 1986-2013 Free Software Foundation, Inc.
+ Copyright (C) 1986-2014 Free Software Foundation, Inc.
This file is part of GDB.
struct block *block;
- gdb_byte *bytes;
+ const gdb_byte *bytes;
CORE_ADDR address;
union
{
+ /* A pointer to an obstack that can be used for storage associated
+ with this symbol. This is only used by Ada, and only when the
+ 'ada_mangled' field is zero. */
+ struct obstack *obstack;
+
/* This is used by languages which wish to store a demangled name.
currently used by Ada, Java, and Objective C. */
struct mangled_lang
ENUM_BITFIELD(language) language : 8;
+ /* This is only used by Ada. If set, then the 'mangled_lang' field
+ of language_specific is valid. Otherwise, the 'obstack' field is
+ valid. */
+ unsigned int ada_mangled : 1;
+
/* Which section is this symbol in? This is an index into
section_offsets for this objfile. Negative means that the symbol
- does not get relocated relative to a section.
- Disclaimer: currently this is just used for xcoff, so don't
- expect all symbol-reading code to set it correctly (the ELF code
- also tries to set it correctly). */
+ does not get relocated relative to a section. */
short section;
-
- /* 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 *,
#define SYMBOL_VALUE_CHAIN(symbol) (symbol)->ginfo.value.chain
#define SYMBOL_LANGUAGE(symbol) (symbol)->ginfo.language
#define SYMBOL_SECTION(symbol) (symbol)->ginfo.section
-#define SYMBOL_OBJ_SECTION(symbol) (symbol)->ginfo.obj_section
+#define SYMBOL_OBJ_SECTION(objfile, symbol) \
+ (((symbol)->ginfo.section >= 0) \
+ ? (&(((objfile)->sections)[(symbol)->ginfo.section])) \
+ : NULL)
/* Initializes the language dependent portion of a symbol
depending upon the language for the symbol. */
-#define SYMBOL_SET_LANGUAGE(symbol,language) \
- (symbol_set_language (&(symbol)->ginfo, (language)))
+#define SYMBOL_SET_LANGUAGE(symbol,language,obstack) \
+ (symbol_set_language (&(symbol)->ginfo, (language), (obstack)))
extern void symbol_set_language (struct general_symbol_info *symbol,
- enum language language);
+ enum language language,
+ struct obstack *obstack);
/* 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,
+ /* MODULE_DOMAIN is used in Fortran to hold module type names. */
+
+ MODULE_DOMAIN,
+
/* LABEL_DOMAIN may be used for names of labels (for gotos). */
LABEL_DOMAIN,
COMMON_BLOCK_DOMAIN
} domain_enum;
+extern const char *domain_name (domain_enum);
+
/* Searching domains, used for `search_symbols'. Element numbers are
hardcoded in GDB, check all enum uses before changing it. */
ALL_DOMAIN = 3
};
+extern const char *search_domain_name (enum search_domain);
+
/* An address-class says where to find the value of a symbol. */
enum address_class
#define SYMBOL_BLOCK_OPS(symbol) (SYMBOL_IMPL (symbol).ops_block)
#define SYMBOL_REGISTER_OPS(symbol) (SYMBOL_IMPL (symbol).ops_register)
#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value
+#define SYMBOL_OBJFILE(symbol) (SYMBOL_SYMTAB (symbol)->objfile)
extern int register_symbol_computed_impl (enum address_class,
const struct symbol_computed_ops *);
/* Name of this source file. This pointer is never NULL. */
- char *filename;
+ const char *filename;
/* Directory in which it was compiled, or NULL if we don't know. */
- char *dirname;
+ const char *dirname;
/* Total number of lines found in source file. */
#define BLOCKVECTOR(symtab) (symtab)->blockvector
#define LINETABLE(symtab) (symtab)->linetable
#define SYMTAB_PSPACE(symtab) (symtab)->objfile->pspace
+
+/* Call this to set the "primary" field in struct symtab. */
+extern void set_symtab_primary (struct symtab *, int primary);
+
+typedef struct symtab *symtab_ptr;
+DEF_VEC_P (symtab_ptr);
+
\f
/* The virtual function table is now an array of structures which have the
int matching_obj_sections (struct obj_section *, struct obj_section *);
-extern const char *find_main_filename (void);
-
extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *);
extern struct symtab_and_line find_function_start_sal (struct symbol *sym,
/* Information describing what was found.
- If symtab abd symbol are NOT NULL, then information was found
+ If symtab and symbol are NOT NULL, then information was found
for this match. */
struct symtab *symtab;
struct symbol *symbol;
/* If msymbol is non-null, then a match was made on something for
which only minimal_symbols exist. */
- struct minimal_symbol *msymbol;
+ struct bound_minimal_symbol msymbol;
/* A link to the next match, or NULL for the end. */
struct symbol_search *next;
struct symbol_search **);
extern void free_search_symbols (struct symbol_search *);
extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search
- *);
+ **);
/* The name of the ``main'' function.
FIXME: cagney/2001-03-20: Can't make main_name() const since some
struct objfile *lookup_objfile_from_block (const struct block *block);
-extern int symtab_create_debug;
+extern unsigned int symtab_create_debug;
extern int basenames_may_differ;