#if !defined (SYMTAB_H)
#define SYMTAB_H 1
+#include "vec.h"
+
/* Opaque declarations. */
struct ui_file;
struct frame_info;
struct axs_value;
struct agent_expr;
struct program_space;
+struct language_defn;
/* Some of the structures in this file are space critical.
The space-critical structures are:
name if demangle is on and the "mangled" form of the name if
demangle is off. In other languages this is just the symbol name.
The result should never be NULL. Don't use this for internal
- purposes (e.g. storing in a hashtable): it's only suitable for
- output. */
+ purposes (e.g. storing in a hashtable): it's only suitable for output.
+
+ N.B. symbol may be anything with a ginfo member,
+ e.g., struct symbol or struct minimal_symbol. */
#define SYMBOL_PRINT_NAME(symbol) \
(demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol))
+extern int demangle;
/* Macro that tests a symbol for a match against a specified name string.
First test the unencoded name, then looks for and test a C++ encoded
LABEL_DOMAIN
} domain_enum;
-/* Searching domains, used for `search_symbols'. */
+/* Searching domains, used for `search_symbols'. Element numbers are
+ hardcoded in GDB, check all enum uses before changing it. */
enum search_domain
{
/* Everything in VAR_DOMAIN minus FUNCTIONS_DOMAIN and
TYPES_DOMAIN. */
- VARIABLES_DOMAIN,
+ VARIABLES_DOMAIN = 0,
/* All functions -- for some reason not methods, though. */
- FUNCTIONS_DOMAIN,
+ FUNCTIONS_DOMAIN = 1,
/* All defined types */
- TYPES_DOMAIN
+ TYPES_DOMAIN = 2,
+
+ /* Any type. */
+ ALL_DOMAIN = 3
};
/* An address-class says where to find the value of a symbol. */
struct value *(*read_variable) (struct symbol * symbol,
struct frame_info * frame);
+ /* Read variable SYMBOL like read_variable at (callee) FRAME's function
+ entry. SYMBOL should be a function parameter, otherwise
+ NO_ENTRY_VALUE_ERROR will be thrown. */
+ struct value *(*read_variable_at_entry) (struct symbol *symbol,
+ struct frame_info *frame);
+
/* Return non-zero if we need a frame to find the value of the SYMBOL. */
int (*read_needs_frame) (struct symbol * symbol);
should be designated the primary, so that the blockvector
is relocated exactly once by objfile_relocate. */
- int primary;
+ unsigned int primary : 1;
+
+ /* Symtab has been compiled with both optimizations and debug info so that
+ GDB may stop skipping prologues as variables locations are valid already
+ at function entry points. */
+
+ unsigned int locations_valid : 1;
+
+ /* DWARF unwinder for this CU is valid even for epilogues (PC at the return
+ instruction). This is supported by GCC since 4.5.0. */
+
+ unsigned int epilogue_unwind_valid : 1;
/* The macro table for this symtab. Like the blockvector, this
may be shared between different symtabs --- and normally is for
struct objfile *objfile;
+ /* struct call_site entries for this compilation unit or NULL. */
+
+ htab_t call_site_htab;
};
#define BLOCKVECTOR(symtab) (symtab)->blockvector
/* External variables and functions for the objects described above. */
-/* See the comment in symfile.c about how current_objfile is used. */
-
-extern struct objfile *current_objfile;
-
/* True if we are nested inside psymtab_to_symtab. */
extern int currently_reading_symtab;
-/* From utils.c. */
-extern int demangle;
-extern int asm_demangle;
-
/* symtab.c lookup functions */
extern const char multiple_symbols_ask[];
const struct block *block,
const domain_enum domain);
+extern struct symbol *lookup_language_this (const struct language_defn *lang,
+ const struct block *block);
+
/* Lookup a symbol only in the file static scope of all the objfiles. */
struct symbol *lookup_static_symbol_aux (const char *name,
/* lookup a [struct, union, enum] by name, within a specified block. */
-extern struct type *lookup_struct (char *, struct block *);
+extern struct type *lookup_struct (const char *, struct block *);
-extern struct type *lookup_union (char *, struct block *);
+extern struct type *lookup_union (const char *, struct block *);
-extern struct type *lookup_enum (char *, struct block *);
+extern struct type *lookup_enum (const char *, struct block *);
/* from blockframe.c: */
extern unsigned int msymbol_hash (const char *);
+/* Compute the next hash value from previous HASH and the character C. This
+ is only a GDB in-memory computed value with no external files compatibility
+ requirements. */
+
+#define SYMBOL_HASH_NEXT(hash, c) \
+ ((hash) * 67 + tolower ((unsigned char) (c)) - 113)
+
extern struct objfile * msymbol_objfile (struct minimal_symbol *sym);
extern void
extern struct minimal_symbol *lookup_minimal_symbol_by_pc (CORE_ADDR);
+extern void iterate_over_minimal_symbols (struct objfile *objf,
+ const char *name,
+ void (*callback) (struct minimal_symbol *,
+ void *),
+ void *user_data);
+
extern int in_gnu_ifunc_stub (CORE_ADDR pc);
/* Functions for resolving STT_GNU_IFUNC symbols which are implemented only
const char *name,
const domain_enum domain);
-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);
struct objfile *lookup_objfile_from_block (const struct block *block);
+extern int basenames_may_differ;
+
+int iterate_over_some_symtabs (const char *name,
+ const char *full_path,
+ const char *real_path,
+ int (*callback) (struct symtab *symtab,
+ void *data),
+ void *data,
+ struct symtab *first,
+ struct symtab *after_last);
+
+void iterate_over_symtabs (const char *name,
+ int (*callback) (struct symtab *symtab,
+ void *data),
+ void *data);
+
+DEF_VEC_I (CORE_ADDR);
+
+VEC (CORE_ADDR) *find_pcs_for_symtab_line (struct symtab *symtab, int line,
+ struct linetable_entry **best_entry);
+
+void iterate_over_symbols (const struct block *block, const char *name,
+ const domain_enum domain,
+ int (*callback) (struct symbol *, void *),
+ void *data);
+
+struct cleanup *demangle_for_lookup (const char *name, enum language lang,
+ const char **result_name);
+
#endif /* !defined(SYMTAB_H) */