/* Symbol table definitions for GDB.
- Copyright 1986, 1989, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright 1986, 1989, 1991, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of GDB.
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
+#include "bcache.h"
/* Don't do this; it means that if some .o's are compiled with GNU C
and some are not (easy to do accidentally the way we configure
/* Different name spaces for symbols. Looking up a symbol specifies a
namespace and ignores symbol definitions in other name spaces. */
-
-enum namespace
+
+typedef enum
{
/* UNDEF_NAMESPACE is used when a namespace has not been discovered or
none of the following apply. This usually indicates an error either
currently it is not used and labels are not recorded at all. */
LABEL_NAMESPACE
-};
+} namespace_enum;
/* An address-class says where to find the value of a symbol. */
LOC_BASEREG_ARG,
+ /* Value is at fixed address, but the address of the variable has
+ to be determined from the minimal symbol table whenever the
+ variable is referenced.
+ This happens if debugging information for a global symbol is
+ emitted and the corresponding minimal symbol is defined
+ in another object file or runtime common storage.
+ The linker might even remove the minimal symbol if the global
+ symbol is never referenced, in which case the symbol remains
+ unresolved. */
+
+ LOC_UNRESOLVED,
+
/* The variable does not actually exist in the program.
The value is ignored. */
/* Name space code. */
- enum namespace namespace BYTE_BITFIELD;
+ namespace_enum namespace BYTE_BITFIELD;
/* Address class */
/* Name space code. */
- enum namespace namespace BYTE_BITFIELD;
+ namespace_enum namespace BYTE_BITFIELD;
/* Address class (for info_symbols) */
#define ANOFFSET(secoff, whichone) (secoff->offsets[whichone])
+/* The maximum possible size of a section_offsets table. */
+
+#define SIZEOF_SECTION_OFFSETS \
+ (sizeof (struct section_offsets) \
+ + sizeof (((struct section_offsets *) 0)->offsets) * (SECT_OFF_MAX-1))
+
+
/* Each source file or header is represented by a struct symtab.
These objects are chained through the `next' field. */
Note that this macro is g++ specific (FIXME). */
#define OPNAME_PREFIX_P(NAME) \
- ((NAME)[0] == 'o' && (NAME)[1] == 'p' && (NAME)[2] == CPLUS_MARKER)
+ ((NAME)[0] == 'o' && (NAME)[1] == 'p' && is_cplus_marker ((NAME)[2]))
/* Macro that yields non-zero value iff NAME is the prefix for C++ vtbl
names. Note that this macro is g++ specific (FIXME).
style, using thunks (where '$' is really CPLUS_MARKER). */
#define VTBL_PREFIX_P(NAME) \
- ((NAME)[3] == CPLUS_MARKER && (NAME)[0] == '_' \
+ ((NAME)[0] == '_' \
&& (((NAME)[1] == 'V' && (NAME)[2] == 'T') \
- || ((NAME)[1] == 'v' && (NAME)[2] == 't')))
+ || ((NAME)[1] == 'v' && (NAME)[2] == 't')) \
+ && is_cplus_marker ((NAME)[3]))
/* Macro that yields non-zero value iff NAME is the prefix for C++ destructor
names. Note that this macro is g++ specific (FIXME). */
#define DESTRUCTOR_PREFIX_P(NAME) \
- ((NAME)[0] == '_' && (NAME)[1] == CPLUS_MARKER && (NAME)[2] == '_')
+ ((NAME)[0] == '_' && is_cplus_marker ((NAME)[1]) && (NAME)[2] == '_')
\f
/* External variables and functions for the objects described above. */
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;
extern struct symbol *
lookup_symbol PARAMS ((const char *, const struct block *,
- const enum namespace, int *, struct symtab **));
+ const namespace_enum, int *, struct symtab **));
extern struct symbol *
lookup_block_symbol PARAMS ((const struct block *, const char *,
- const enum namespace));
+ const namespace_enum));
extern struct type *
lookup_struct PARAMS ((char *, struct block *));
extern struct minimal_symbol *
lookup_minimal_symbol_text PARAMS ((const char *, const char *, struct objfile *));
+struct minimal_symbol *
+lookup_minimal_symbol_solib_trampoline PARAMS ((const char *,
+ const char *,
+ struct objfile *));
+
extern struct minimal_symbol *
lookup_minimal_symbol_by_pc PARAMS ((CORE_ADDR));