/* Symbol table definitions for GDB.
- Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
- Foundation, Inc.
+ Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
+ Free Software Foundation, Inc.
This file is part of GDB.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
#if !defined (SYMTAB_H)
#define SYMTAB_H 1
struct blockvector;
struct axs_value;
struct agent_expr;
+enum language;
/* Some of the structures in this file are space critical.
The space-critical structures are:
struct symbol
struct partial_symbol
- These structures are layed out to encourage good packing.
+ These structures are laid out to encourage good packing.
They use ENUM_BITFIELD and short int fields, and they order the
structure members so that fields less than a word are next
to each other so they can be packed together. */
struct general_symbol_info
{
/* Name of the symbol. This is a required field. Storage for the
- name is allocated on the objfile_obstack or symbol_obstack for
- the associated objfile. For languages like C++ that make a
- distinction between the mangled name and demangled name, this is
- the mangled name. */
+ name is allocated on the objfile_obstack for the associated
+ objfile. For languages like C++ that make a distinction between
+ the mangled name and demangled name, this is the mangled
+ name. */
char *name;
struct block *block;
- char *bytes;
+ gdb_byte *bytes;
CORE_ADDR address;
#define SYMBOL_MATCHES_NATURAL_NAME(symbol, name) \
(strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0)
+/* Macro that returns the name to be used when sorting and searching symbols.
+ In C++, Chill, and Java, we search for the demangled form of a name,
+ and so sort symbols accordingly. In Ada, however, we search by mangled
+ name. If there is no distinct demangled name, then SYMBOL_SEARCH_NAME
+ returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */
+#define SYMBOL_SEARCH_NAME(symbol) \
+ (symbol_search_name (&(symbol)->ginfo))
+extern char *symbol_search_name (const struct general_symbol_info *);
+
+/* Analogous to SYMBOL_MATCHES_NATURAL_NAME, but uses the search
+ name. */
+#define SYMBOL_MATCHES_SEARCH_NAME(symbol, name) \
+ (strcmp_iw (SYMBOL_SEARCH_NAME (symbol), (name)) == 0)
+
/* Classification types for a minimal symbol. These should be taken as
"advisory only", since if gdb can't easily figure out a
classification it simply selects mst_unknown. It may also have to
struct general_symbol_info ginfo;
- /* The info field is available for caching machine-specific information
- so it doesn't have to rederive the info constantly (over a serial line).
- It is initialized to zero and stays that way until target-dependent code
- sets it. Storage for any data pointed to by this field should be allo-
- cated on the symbol_obstack for the associated objfile.
- The type would be "void *" except for reasons of compatibility with older
+ /* The info field is available for caching machine-specific
+ information so it doesn't have to rederive the info constantly
+ (over a serial line). It is initialized to zero and stays that
+ way until target-dependent code sets it. Storage for any data
+ pointed to by this field should be allocated on the
+ objfile_obstack for the associated objfile. The type would be
+ "void *" except for reasons of compatibility with older
compilers. This field is optional.
Currently, the AMD 29000 tdep.c uses it to remember things it has decoded
LOC_INDIRECT,
/* The variable's address is computed by a set of location
- functions (see "struct location_funcs" below). */
+ functions (see "struct symbol_ops" below). */
LOC_COMPUTED,
/* Same as LOC_COMPUTED, but for function arguments. */
struct type *type;
+ /* The symbol table containing this symbol. This is the file
+ associated with LINE. */
+ struct symtab *symtab;
+
/* Domain code. */
ENUM_BITFIELD(domain_enum_tag) domain : 6;
#define SYMBOL_CLASS(symbol) (symbol)->aclass
#define SYMBOL_TYPE(symbol) (symbol)->type
#define SYMBOL_LINE(symbol) (symbol)->line
+#define SYMBOL_SYMTAB(symbol) (symbol)->symtab
#define SYMBOL_BASEREG(symbol) (symbol)->aux_value.basereg
#define SYMBOL_OBJFILE(symbol) (symbol)->aux_value.objfile
#define SYMBOL_OPS(symbol) (symbol)->ops
#define ANOFFSET(secoff, whichone) \
((whichone == -1) \
- ? (internal_error (__FILE__, __LINE__, "Section index is uninitialized"), -1) \
+ ? (internal_error (__FILE__, __LINE__, _("Section index is uninitialized")), -1) \
: secoff->offsets[whichone])
/* The size of a section_offsets table for N sections. */
char *debugformat;
- /* String of version information. May be zero. */
+ /* String of producer version information. May be zero. */
- char *version;
+ char *producer;
/* Full name of file as found by searching the source path.
NULL if not yet known. */
char *fullname;
+ /* Directory in which it was compiled, or NULL if we don't know. */
+
+ char *dirname;
+
/* Information about the object file from which symbols should be read. */
struct objfile *objfile;
extern struct symtab *lookup_symtab (const char *);
-/* lookup a symbol by name (optional block, optional symtab) */
+/* lookup a symbol by name (optional block, optional symtab) in language */
+
+extern struct symbol *lookup_symbol_in_language (const char *,
+ const struct block *,
+ const domain_enum,
+ enum language,
+ int *,
+ struct symtab **);
+
+/* lookup a symbol by name (optional block, optional symtab)
+ in the current language */
extern struct symbol *lookup_symbol (const char *, const struct block *,
const domain_enum, int *,
extern void clear_pc_function_cache (void);
-extern int find_pc_sect_partial_function (CORE_ADDR, asection *,
- char **, CORE_ADDR *, CORE_ADDR *);
-
/* from symtab.c: */
/* lookup partial symbol table by filename */
extern struct minimal_symbol
*lookup_solib_trampoline_symbol_by_pc (CORE_ADDR);
-extern CORE_ADDR find_solib_trampoline_target (CORE_ADDR);
+extern CORE_ADDR find_solib_trampoline_target (struct frame_info *, CORE_ADDR);
extern void init_minimal_symbol_collection (void);
/* symtab.c */
+int matching_bfd_sections (asection *, asection *);
+
extern struct partial_symtab *find_main_psymtab (void);
extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *);
extern int in_prologue (CORE_ADDR pc, CORE_ADDR func_start);
+extern CORE_ADDR skip_prologue_using_sal (CORE_ADDR func_addr);
+
extern struct symbol *fixup_symbol_section (struct symbol *,
struct objfile *);