Obvious fix: in an entry for 1997-09-10, expand wildcard to explicit
[deliverable/binutils-gdb.git] / gdb / symtab.h
index 86a119a115e32c5edc418a502fcf66511f7dcff5..c7f52a7d7027dbb1ca7e72222b68769d7cc2c9af 100644 (file)
@@ -1,5 +1,5 @@
 /* Symbol table definitions for GDB.
-   Copyright 1986, 89, 91, 92, 93, 94, 95, 96, 1998
+   Copyright 1986, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -26,7 +26,7 @@
 
 #include "obstack.h"
 #define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
+#define obstack_chunk_free xfree
 #include "bcache.h"
 
 /* Don't do this; it means that if some .o's are compiled with GNU C
@@ -120,7 +120,7 @@ struct general_symbol_info
     asection *bfd_section;
   };
 
-extern CORE_ADDR symbol_overlayed_address PARAMS ((CORE_ADDR, asection *));
+extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
 
 #define SYMBOL_NAME(symbol)            (symbol)->ginfo.name
 #define SYMBOL_VALUE(symbol)           (symbol)->ginfo.value.ivalue
@@ -170,6 +170,8 @@ extern CORE_ADDR symbol_overlayed_address PARAMS ((CORE_ADDR, asection *));
 #define SYMBOL_INIT_DEMANGLED_NAME(symbol,obstack)                     \
   do {                                                                 \
     char *demangled = NULL;                                            \
+    if (SYMBOL_LANGUAGE (symbol) == language_unknown)                 \
+          SYMBOL_LANGUAGE (symbol) = language_auto;                    \
     if (SYMBOL_LANGUAGE (symbol) == language_cplus                     \
        || SYMBOL_LANGUAGE (symbol) == language_auto)                   \
       {                                                                        \
@@ -180,7 +182,7 @@ extern CORE_ADDR symbol_overlayed_address PARAMS ((CORE_ADDR, asection *));
            SYMBOL_LANGUAGE (symbol) = language_cplus;                  \
            SYMBOL_CPLUS_DEMANGLED_NAME (symbol) =                      \
              obsavestring (demangled, strlen (demangled), (obstack));  \
-           free (demangled);                                           \
+           xfree (demangled);                                          \
          }                                                             \
        else                                                            \
          {                                                             \
@@ -197,7 +199,7 @@ extern CORE_ADDR symbol_overlayed_address PARAMS ((CORE_ADDR, asection *));
            SYMBOL_LANGUAGE (symbol) = language_java;                   \
            SYMBOL_CPLUS_DEMANGLED_NAME (symbol) =                      \
              obsavestring (demangled, strlen (demangled), (obstack));  \
-           free (demangled);                                           \
+           xfree (demangled);                                          \
          }                                                             \
        else                                                            \
          {                                                             \
@@ -215,17 +217,13 @@ extern CORE_ADDR symbol_overlayed_address PARAMS ((CORE_ADDR, asection *));
            SYMBOL_LANGUAGE (symbol) = language_chill;                  \
            SYMBOL_CHILL_DEMANGLED_NAME (symbol) =                      \
              obsavestring (demangled, strlen (demangled), (obstack));  \
-           free (demangled);                                           \
+           xfree (demangled);                                          \
          }                                                             \
        else                                                            \
          {                                                             \
            SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL;                \
          }                                                             \
       }                                                                        \
-    if (SYMBOL_LANGUAGE (symbol) == language_auto)                     \
-      {                                                                        \
-       SYMBOL_LANGUAGE (symbol) = language_unknown;                    \
-      }                                                                        \
   } while (0)
 
 /* Macro that returns the demangled name for a symbol based on the language
@@ -357,10 +355,21 @@ struct minimal_symbol
        mst_file_bss            /* Static version of mst_bss */
       }
     type BYTE_BITFIELD;
+
+    /* Minimal symbols with the same hash key are kept on a linked
+       list.  This is the link.  */
+
+    struct minimal_symbol *hash_next;
+
+    /* Minimal symbols are stored in two different hash tables.  This is
+       the `next' pointer for the demangled hash table.  */
+
+    struct minimal_symbol *demangled_hash_next;
   };
 
 #define MSYMBOL_INFO(msymbol)          (msymbol)->info
 #define MSYMBOL_TYPE(msymbol)          (msymbol)->type
+
 \f
 
 /* All of the name-scope contours of the program
@@ -752,7 +761,7 @@ struct partial_symbol
 \f
 
 /* Source-file information.  This describes the relation between source files,
-   ine numbers and addresses in the program text.  */
+   line numbers and addresses in the program text.  */
 
 struct sourcevector
   {
@@ -818,7 +827,10 @@ struct section_offsets
     CORE_ADDR offsets[1];      /* As many as needed. */
   };
 
-#define        ANOFFSET(secoff, whichone)      (secoff->offsets[whichone])
+#define        ANOFFSET(secoff, whichone) \
+   ((whichone == -1) \
+    ? (internal_error (__FILE__, __LINE__, "Section index is uninitialized"), -1) \
+    : secoff->offsets[whichone])
 
 /* The maximum possible size of a section_offsets table.  */
 
@@ -826,7 +838,6 @@ struct 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.  */
 
@@ -854,7 +865,7 @@ struct symtab
     int block_line_section;
 
     /* If several symtabs share a blockvector, exactly one of them
-       should be designed the primary, so that the blockvector
+       should be designated the primary, so that the blockvector
        is relocated exactly once by objfile_relocate.  */
 
     int primary;
@@ -1001,7 +1012,7 @@ struct partial_symtab
     /* Pointer to function which will read in the symtab corresponding to
        this psymtab.  */
 
-    void (*read_symtab) PARAMS ((struct partial_symtab *));
+    void (*read_symtab) (struct partial_symtab *);
 
     /* Information that lets read_symtab() locate the part of the symbol table
        that this psymtab corresponds to.  This information is private to the
@@ -1035,13 +1046,9 @@ struct partial_symtab
 #define VTBL_FNADDR_OFFSET 2
 
 /* Macro that yields non-zero value iff NAME is the prefix for C++ operator
-   names.  If you leave out the parenthesis here you will lose!
-   Currently 'o' 'p' CPLUS_MARKER is used for both the symbol in the
-   symbol-file and the names in gdb's symbol table.
-   Note that this macro is g++ specific (FIXME). */
-
+   names.  If you leave out the parenthesis here you will lose!  */
 #define OPNAME_PREFIX_P(NAME) \
-  ((NAME)[0] == 'o' && (NAME)[1] == 'p' && is_cplus_marker ((NAME)[2]))
+  (!strncmp (NAME, "operator", 8))
 
 /* Macro that yields non-zero value iff NAME is the prefix for C++ vtbl
    names.  Note that this macro is g++ specific (FIXME).
@@ -1049,10 +1056,11 @@ struct partial_symtab
    style, using thunks (where '$' is really CPLUS_MARKER). */
 
 #define VTBL_PREFIX_P(NAME) \
-  ((NAME)[0] == '_' \
+  (((NAME)[0] == '_' \
    && (((NAME)[1] == 'V' && (NAME)[2] == 'T') \
        || ((NAME)[1] == 'v' && (NAME)[2] == 't')) \
-   && is_cplus_marker ((NAME)[3]))
+   && is_cplus_marker ((NAME)[3])) || ((NAME)[0]=='_' && (NAME)[1]=='_' \
+   && (NAME)[2]=='v' && (NAME)[3]=='t' && (NAME)[4]=='_'))
 
 /* Macro that yields non-zero value iff NAME is the prefix for C++ destructor
    names.  Note that this macro is g++ specific (FIXME).  */
@@ -1087,110 +1095,91 @@ extern int asm_demangle;
 
 /* lookup a symbol table by source file name */
 
-extern struct symtab *
-  lookup_symtab PARAMS ((char *));
+extern struct symtab *lookup_symtab (char *);
 
 /* lookup a symbol by name (optional block, optional symtab) */
 
-extern struct symbol *
-  lookup_symbol PARAMS ((const char *, const struct block *,
-                        const namespace_enum, int *, struct symtab **));
+extern struct symbol *lookup_symbol (const char *, const struct block *,
+                                    const namespace_enum, int *,
+                                    struct symtab **);
 
 /* lookup a symbol by name, within a specified block */
 
-extern struct symbol *
-  lookup_block_symbol PARAMS ((const struct block *, const char *,
-                              const namespace_enum));
+extern struct symbol *lookup_block_symbol (const struct block *, const char *,
+                                          const namespace_enum);
 
 /* lookup a [struct, union, enum] by name, within a specified block */
 
-extern struct type *
-  lookup_struct PARAMS ((char *, struct block *));
+extern struct type *lookup_struct (char *, struct block *);
 
-extern struct type *
-  lookup_union PARAMS ((char *, struct block *));
+extern struct type *lookup_union (char *, struct block *);
 
-extern struct type *
-  lookup_enum PARAMS ((char *, struct block *));
+extern struct type *lookup_enum (char *, struct block *);
 
 /* lookup the function corresponding to the block */
 
-extern struct symbol *
-  block_function PARAMS ((struct block *));
+extern struct symbol *block_function (struct block *);
 
 /* from blockframe.c: */
 
 /* lookup the function symbol corresponding to the address */
 
-extern struct symbol *
-  find_pc_function PARAMS ((CORE_ADDR));
+extern struct symbol *find_pc_function (CORE_ADDR);
 
 /* lookup the function corresponding to the address and section */
 
-extern struct symbol *
-  find_pc_sect_function PARAMS ((CORE_ADDR, asection *));
+extern struct symbol *find_pc_sect_function (CORE_ADDR, asection *);
 
 /* lookup function from address, return name, start addr and end addr */
 
 extern int
-find_pc_partial_function PARAMS ((CORE_ADDR, char **,
-                                 CORE_ADDR *, CORE_ADDR *));
+find_pc_partial_function (CORE_ADDR, char **, CORE_ADDR *, CORE_ADDR *);
 
-extern void
-clear_pc_function_cache PARAMS ((void));
+extern void clear_pc_function_cache (void);
 
 extern int
-find_pc_sect_partial_function PARAMS ((CORE_ADDR, asection *,
-                                      char **, CORE_ADDR *, CORE_ADDR *));
+find_pc_sect_partial_function (CORE_ADDR, asection *,
+                              char **, CORE_ADDR *, CORE_ADDR *);
 
 /* from symtab.c: */
 
 /* lookup partial symbol table by filename */
 
-extern struct partial_symtab *
-  lookup_partial_symtab PARAMS ((char *));
+extern struct partial_symtab *lookup_partial_symtab (char *);
 
 /* lookup partial symbol table by address */
 
-extern struct partial_symtab *
-  find_pc_psymtab PARAMS ((CORE_ADDR));
+extern struct partial_symtab *find_pc_psymtab (CORE_ADDR);
 
 /* lookup partial symbol table by address and section */
 
-extern struct partial_symtab *
-  find_pc_sect_psymtab PARAMS ((CORE_ADDR, asection *));
+extern struct partial_symtab *find_pc_sect_psymtab (CORE_ADDR, asection *);
 
 /* lookup full symbol table by address */
 
-extern struct symtab *
-  find_pc_symtab PARAMS ((CORE_ADDR));
+extern struct symtab *find_pc_symtab (CORE_ADDR);
 
 /* lookup full symbol table by address and section */
 
-extern struct symtab *
-  find_pc_sect_symtab PARAMS ((CORE_ADDR, asection *));
+extern struct symtab *find_pc_sect_symtab (CORE_ADDR, asection *);
 
 /* lookup partial symbol by address */
 
-extern struct partial_symbol *
-  find_pc_psymbol PARAMS ((struct partial_symtab *, CORE_ADDR));
+extern struct partial_symbol *find_pc_psymbol (struct partial_symtab *,
+                                              CORE_ADDR);
 
 /* lookup partial symbol by address and section */
 
-extern struct partial_symbol *
-  find_pc_sect_psymbol PARAMS ((struct partial_symtab *, CORE_ADDR, asection *));
+extern struct partial_symbol *find_pc_sect_psymbol (struct partial_symtab *,
+                                                   CORE_ADDR, asection *);
 
-extern int
-find_pc_line_pc_range PARAMS ((CORE_ADDR, CORE_ADDR *, CORE_ADDR *));
+extern int find_pc_line_pc_range (CORE_ADDR, CORE_ADDR *, CORE_ADDR *);
 
-extern int
-contained_in PARAMS ((struct block *, struct block *));
+extern int contained_in (struct block *, struct block *);
 
-extern void
-reread_symbols PARAMS ((void));
+extern void reread_symbols (void);
 
-extern struct type *
-  lookup_transparent_type PARAMS ((const char *));
+extern struct type *lookup_transparent_type (const char *);
 
 
 /* Macro for name of symbol to indicate a file compiled with gcc. */
@@ -1206,58 +1195,60 @@ extern struct type *
 /* Functions for dealing with the minimal symbol table, really a misc
    address<->symbol mapping for things we don't have debug symbols for.  */
 
-extern void prim_record_minimal_symbol PARAMS ((const char *, CORE_ADDR,
-                                               enum minimal_symbol_type,
-                                               struct objfile *));
+extern void prim_record_minimal_symbol (const char *, CORE_ADDR,
+                                       enum minimal_symbol_type,
+                                       struct objfile *);
 
 extern struct minimal_symbol *prim_record_minimal_symbol_and_info
-  PARAMS ((const char *, CORE_ADDR,
-          enum minimal_symbol_type,
-          char *info, int section,
-          asection * bfd_section,
-          struct objfile *));
+  (const char *, CORE_ADDR,
+   enum minimal_symbol_type,
+   char *info, int section, asection * bfd_section, struct objfile *);
 
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
-extern CORE_ADDR find_stab_function_addr PARAMS ((char *,
-                                                 struct partial_symtab *,
-                                                 struct objfile *));
+extern CORE_ADDR find_stab_function_addr (char *, char *, struct objfile *);
 #endif
 
-extern struct minimal_symbol *
-  lookup_minimal_symbol PARAMS ((const char *, const char *, struct objfile *));
+extern unsigned int msymbol_hash_iw (const char *);
 
-extern struct minimal_symbol *
-  lookup_minimal_symbol_text PARAMS ((const char *, const char *, struct objfile *));
+extern unsigned int msymbol_hash (const char *);
 
-struct minimal_symbol *
-  lookup_minimal_symbol_solib_trampoline PARAMS ((const char *,
-                                                 const char *,
-                                                 struct objfile *));
+extern void
+add_minsym_to_hash_table (struct minimal_symbol *sym,
+                         struct minimal_symbol **table);
 
-extern struct minimal_symbol *
-  lookup_minimal_symbol_by_pc PARAMS ((CORE_ADDR));
+extern struct minimal_symbol *lookup_minimal_symbol (const char *,
+                                                    const char *,
+                                                    struct objfile *);
 
-extern struct minimal_symbol *
-  lookup_minimal_symbol_by_pc_section PARAMS ((CORE_ADDR, asection *));
+extern struct minimal_symbol *lookup_minimal_symbol_text (const char *,
+                                                         const char *,
+                                                         struct objfile *);
 
-extern struct minimal_symbol *
-  lookup_solib_trampoline_symbol_by_pc PARAMS ((CORE_ADDR));
+struct minimal_symbol *lookup_minimal_symbol_solib_trampoline (const char *,
+                                                              const char *,
+                                                              struct objfile
+                                                              *);
 
-extern CORE_ADDR
-  find_solib_trampoline_target PARAMS ((CORE_ADDR));
+extern struct minimal_symbol *lookup_minimal_symbol_by_pc (CORE_ADDR);
 
-extern void
-init_minimal_symbol_collection PARAMS ((void));
+extern struct minimal_symbol *lookup_minimal_symbol_by_pc_section (CORE_ADDR,
+                                                                  asection
+                                                                  *);
 
-extern void
-discard_minimal_symbols PARAMS ((int));
+extern struct minimal_symbol
+  *lookup_solib_trampoline_symbol_by_pc (CORE_ADDR);
 
-extern void
-install_minimal_symbols PARAMS ((struct objfile *));
+extern CORE_ADDR find_solib_trampoline_target (CORE_ADDR);
+
+extern void init_minimal_symbol_collection (void);
+
+extern struct cleanup *make_cleanup_discard_minimal_symbols (void);
+
+extern void install_minimal_symbols (struct objfile *);
 
 /* Sort all the minimal symbols in OBJFILE.  */
 
-extern void msymbols_sort PARAMS ((struct objfile * objfile));
+extern void msymbols_sort (struct objfile *objfile);
 
 struct symtab_and_line
   {
@@ -1326,134 +1317,114 @@ struct exception_event_record
 /* Given a pc value, return line number it is in.  Second arg nonzero means
    if pc is on the boundary use the previous statement's line number.  */
 
-extern struct symtab_and_line
-find_pc_line PARAMS ((CORE_ADDR, int));
+extern struct symtab_and_line find_pc_line (CORE_ADDR, int);
 
 /* Same function, but specify a section as well as an address */
 
-extern struct symtab_and_line
-find_pc_sect_line PARAMS ((CORE_ADDR, asection *, int));
+extern struct symtab_and_line find_pc_sect_line (CORE_ADDR, asection *, int);
 
 /* Given an address, return the nearest symbol at or below it in memory.
    Optionally return the symtab it's from through 2nd arg, and the
    address in inferior memory of the symbol through 3rd arg.  */
 
-extern struct symbol *
-  find_addr_symbol PARAMS ((CORE_ADDR, struct symtab **, CORE_ADDR *));
+extern struct symbol *find_addr_symbol (CORE_ADDR, struct symtab **,
+                                       CORE_ADDR *);
 
 /* Given a symtab and line number, return the pc there.  */
 
-extern int
-find_line_pc PARAMS ((struct symtab *, int, CORE_ADDR *));
+extern int find_line_pc (struct symtab *, int, CORE_ADDR *);
 
 extern int
-find_line_pc_range PARAMS ((struct symtab_and_line,
-                           CORE_ADDR *, CORE_ADDR *));
+find_line_pc_range (struct symtab_and_line, CORE_ADDR *, CORE_ADDR *);
 
-extern void
-resolve_sal_pc PARAMS ((struct symtab_and_line *));
+extern void resolve_sal_pc (struct symtab_and_line *);
 
 /* Given a string, return the line specified by it.  For commands like "list"
    and "breakpoint".  */
 
-extern struct symtabs_and_lines
-decode_line_spec PARAMS ((char *, int));
+extern struct symtabs_and_lines decode_line_spec (char *, int);
 
-extern struct symtabs_and_lines
-decode_line_spec_1 PARAMS ((char *, int));
+extern struct symtabs_and_lines decode_line_spec_1 (char *, int);
 
-extern struct symtabs_and_lines
-decode_line_1 PARAMS ((char **, int, struct symtab *, int, char ***));
+/* From linespec.c */
+
+extern struct symtabs_and_lines decode_line_1 (char **,
+                                          int, struct symtab *, int, char ***);
 
 /* Symmisc.c */
 
-void
-maintenance_print_symbols PARAMS ((char *, int));
+void maintenance_print_symbols (char *, int);
 
-void
-maintenance_print_psymbols PARAMS ((char *, int));
+void maintenance_print_psymbols (char *, int);
 
-void
-maintenance_print_msymbols PARAMS ((char *, int));
+void maintenance_print_msymbols (char *, int);
 
-void
-maintenance_print_objfiles PARAMS ((char *, int));
+void maintenance_print_objfiles (char *, int);
 
-void
-maintenance_check_symtabs PARAMS ((char *, int));
+void maintenance_check_symtabs (char *, int);
 
 /* maint.c */
 
-void
-maintenance_print_statistics PARAMS ((char *, int));
+void maintenance_print_statistics (char *, int);
 
-extern void
-free_symtab PARAMS ((struct symtab *));
+extern void free_symtab (struct symtab *);
 
 /* Symbol-reading stuff in symfile.c and solib.c.  */
 
-extern struct symtab *
-  psymtab_to_symtab PARAMS ((struct partial_symtab *));
-
-extern void
-clear_solib PARAMS ((void));
+extern struct symtab *psymtab_to_symtab (struct partial_symtab *);
 
-extern struct objfile *
-  symbol_file_add PARAMS ((char *, int, CORE_ADDR, int, int, int, int, int));
+extern void clear_solib (void);
 
 /* source.c */
 
-extern int
-identify_source_line PARAMS ((struct symtab *, int, int, CORE_ADDR));
+extern int identify_source_line (struct symtab *, int, int, CORE_ADDR);
 
-extern void
-print_source_lines PARAMS ((struct symtab *, int, int, int));
+extern void print_source_lines (struct symtab *, int, int, int);
 
-extern void
-forget_cached_source_info PARAMS ((void));
+extern void forget_cached_source_info (void);
 
-extern void
-select_source_symtab PARAMS ((struct symtab *));
+extern void select_source_symtab (struct symtab *);
 
-extern char **make_symbol_completion_list PARAMS ((char *, char *));
+extern char **make_symbol_completion_list (char *, char *);
 
-extern struct symbol **
-  make_symbol_overload_list PARAMS ((struct symbol *));
+extern struct symbol **make_symbol_overload_list (struct symbol *);
 
 /* symtab.c */
 
-extern struct partial_symtab *
-  find_main_psymtab PARAMS ((void));
+extern struct partial_symtab *find_main_psymtab (void);
+
+extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *);
+
+extern struct symtab_and_line find_function_start_sal (struct symbol *sym, int);
 
 /* blockframe.c */
 
-extern struct blockvector *
-  blockvector_for_pc PARAMS ((CORE_ADDR, int *));
+extern struct blockvector *blockvector_for_pc (CORE_ADDR, int *);
 
-extern struct blockvector *
-  blockvector_for_pc_sect PARAMS ((CORE_ADDR, asection *, int *,
-                                  struct symtab *));
+extern struct blockvector *blockvector_for_pc_sect (CORE_ADDR, asection *,
+                                                   int *, struct symtab *);
 
 /* symfile.c */
 
-extern void
-clear_symtab_users PARAMS ((void));
+extern void clear_symtab_users (void);
 
-extern enum language
-deduce_language_from_filename PARAMS ((char *));
+extern enum language deduce_language_from_filename (char *);
 
 /* symtab.c */
 
-extern int
-in_prologue PARAMS ((CORE_ADDR pc, CORE_ADDR func_start));
+extern int in_prologue (CORE_ADDR pc, CORE_ADDR func_start);
+
+extern struct symbol *fixup_symbol_section (struct symbol *,
+                                           struct objfile *);
 
-extern struct symbol *
-  fixup_symbol_section PARAMS ((struct symbol *, struct objfile *));
+extern struct partial_symbol *fixup_psymbol_section (struct partial_symbol
+                                                    *psym,
+                                                    struct objfile *objfile);
 
 /* Symbol searching */
 
 /* When using search_symbols, a list of the following structs is returned.
-   Callers must free the search list using free_symbol_search! */
+   Callers must free the search list using free_search_symbols! */
 struct symbol_search
   {
     /* The block in which the match was found. Could be, for example,
@@ -1475,7 +1446,9 @@ struct symbol_search
     struct symbol_search *next;
   };
 
-extern void search_symbols PARAMS ((char *, namespace_enum, int, char **, struct symbol_search **));
-extern void free_search_symbols PARAMS ((struct symbol_search *));
+extern void search_symbols (char *, namespace_enum, int, char **,
+                           struct symbol_search **);
+extern void free_search_symbols (struct symbol_search *);
+extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search *);
 
 #endif /* !defined(SYMTAB_H) */
This page took 0.032346 seconds and 4 git commands to generate.