* ada-lang.c: Update throughout to use symbol_matches_domain
[deliverable/binutils-gdb.git] / gdb / symtab.h
index 97899b0b56134e4315ae788f55b36d8f2077db61..ef8cade3a2efc2eec5e9c934c8ee404f25248ebf 100644 (file)
@@ -1,14 +1,14 @@
 /* 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, 2008
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -17,9 +17,7 @@
    GNU General Public License for more details.
 
    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.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #if !defined (SYMTAB_H)
 #define SYMTAB_H 1
@@ -110,7 +108,7 @@ struct general_symbol_info
 
     struct block *block;
 
-    char *bytes;
+    gdb_byte *bytes;
 
     CORE_ADDR address;
 
@@ -159,8 +157,8 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
 /* Note that all the following SYMBOL_* macros are used with the
    SYMBOL argument being either a partial symbol, a minimal symbol or
    a full symbol.  All three types have a ginfo field.  In particular
-   the SYMBOL_INIT_LANGUAGE_SPECIFIC, SYMBOL_INIT_DEMANGLED_NAME,
-   SYMBOL_DEMANGLED_NAME macros cannot be entirely substituted by
+   the SYMBOL_INIT_LANGUAGE_SPECIFIC, SYMBOL_DEMANGLED_NAME, etc.
+   macros cannot be entirely substituted by
    functions, unless the callers are changed to pass in the ginfo
    field only, instead of the SYMBOL parameter.  */
 
@@ -184,11 +182,6 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
 extern void symbol_init_language_specific (struct general_symbol_info *symbol,
                                           enum language language);
 
-#define SYMBOL_INIT_DEMANGLED_NAME(symbol,obstack) \
-  (symbol_init_demangled_name (&(symbol)->ginfo, (obstack)))
-extern void symbol_init_demangled_name (struct general_symbol_info *symbol,
-                                       struct obstack *obstack);
-
 #define SYMBOL_SET_NAMES(symbol,linkage_name,len,objfile) \
   symbol_set_names (&(symbol)->ginfo, linkage_name, len, objfile)
 extern void symbol_set_names (struct general_symbol_info *symbol,
@@ -346,10 +339,8 @@ struct minimal_symbol
 
   unsigned long size;
 
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
   /* Which source file is this symbol in?  Only relevant for mst_file_*.  */
   char *filename;
-#endif
 
   /* Classification type for this minimal symbol.  */
 
@@ -554,7 +545,7 @@ enum address_class
   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.  */
@@ -609,6 +600,10 @@ struct symbol
 
   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;
@@ -635,7 +630,7 @@ struct symbol
   const struct symbol_ops *ops;
 
   /* Some symbols require additional information to be recorded on a
-     per- symbol basis.  Stash those values here. */
+     per-symbol basis.  Stash those values here.  */
 
   union
   {
@@ -644,7 +639,7 @@ struct symbol
     /* An arbitrary data pointer.  Note that this data must be
        allocated using the same obstack as the symbol itself.  */
     /* So far it is only used by LOC_COMPUTED and LOC_COMPUTED_ARG to
-       find the location location information.  For a LOC_BLOCK symbol
+       find the location information.  For a LOC_BLOCK symbol
        for a function in a compilation unit compiled with DWARF 2
        information, this is information used internally by the DWARF 2
        code --- specifically, the location expression for the frame
@@ -664,8 +659,8 @@ struct symbol
 #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 SYMBOL_LOCATION_BATON(symbol)   (symbol)->aux_value.ptr
 \f
@@ -754,7 +749,7 @@ struct section_offsets
 
 #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.  */
@@ -808,7 +803,6 @@ struct symtab
   char *dirname;
 
   /* This component says how to free the data we point to:
-     free_contents => do a tree walk and free each object.
      free_nothing => do nothing; some other symtab will free
      the data this one uses.
      free_linetable => free just the linetable.  FIXME: Is this redundant
@@ -816,7 +810,7 @@ struct symtab
 
   enum free_code
   {
-    free_nothing, free_contents, free_linetable
+    free_nothing, free_linetable
   }
   free_code;
 
@@ -846,9 +840,9 @@ struct symtab
 
   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.  */
@@ -998,11 +992,31 @@ extern int asm_demangle;
 
 /* symtab.c lookup functions */
 
+extern const char multiple_symbols_ask[];
+extern const char multiple_symbols_all[];
+extern const char multiple_symbols_cancel[];
+
+const char *multiple_symbols_select_mode (void);
+
+int symbol_matches_domain (enum language symbol_language, 
+                          domain_enum symbol_domain,
+                          domain_enum domain);
+
 /* lookup a symbol table by source file name */
 
 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 *,
@@ -1034,6 +1048,7 @@ extern struct symbol *lookup_symbol_static (const char *name,
 
 extern struct symbol *lookup_symbol_global (const char *name,
                                            const char *linkage_name,
+                                           const struct block *block,
                                            const domain_enum domain,
                                            struct symtab **symtab);
 
@@ -1151,6 +1166,8 @@ extern unsigned int msymbol_hash_iw (const char *);
 
 extern unsigned int msymbol_hash (const char *);
 
+extern struct objfile * msymbol_objfile (struct minimal_symbol *sym);
+
 extern void
 add_minsym_to_hash_table (struct minimal_symbol *sym,
                          struct minimal_symbol **table);
@@ -1175,7 +1192,7 @@ extern struct minimal_symbol *lookup_minimal_symbol_by_pc_section (CORE_ADDR,
 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);
 
@@ -1198,6 +1215,8 @@ struct symtab_and_line
 
   CORE_ADDR pc;
   CORE_ADDR end;
+  int explicit_pc;
+  int explicit_line;
 };
 
 extern void init_sal (struct symtab_and_line *sal);
@@ -1222,27 +1241,6 @@ enum exception_event_kind
   EX_EVENT_CATCH
 };
 
-/* Type for returning info about an exception */
-struct exception_event_record
-{
-  enum exception_event_kind kind;
-  struct symtab_and_line throw_sal;
-  struct symtab_and_line catch_sal;
-  /* This may need to be extended in the future, if
-     some platforms allow reporting more information,
-     such as point of rethrow, type of exception object,
-     type expected by catch clause, etc. */
-};
-
-#define CURRENT_EXCEPTION_KIND       (current_exception_event->kind)
-#define CURRENT_EXCEPTION_CATCH_SAL  (current_exception_event->catch_sal)
-#define CURRENT_EXCEPTION_CATCH_LINE (current_exception_event->catch_sal.line)
-#define CURRENT_EXCEPTION_CATCH_FILE (current_exception_event->catch_sal.symtab->filename)
-#define CURRENT_EXCEPTION_CATCH_PC   (current_exception_event->catch_sal.pc)
-#define CURRENT_EXCEPTION_THROW_SAL  (current_exception_event->throw_sal)
-#define CURRENT_EXCEPTION_THROW_LINE (current_exception_event->throw_sal.line)
-#define CURRENT_EXCEPTION_THROW_FILE (current_exception_event->throw_sal.symtab->filename)
-#define CURRENT_EXCEPTION_THROW_PC   (current_exception_event->throw_sal.pc)
 \f
 
 /* Given a pc value, return line number it is in.  Second arg nonzero means
@@ -1308,6 +1306,7 @@ extern void forget_cached_source_info (void);
 
 extern void select_source_symtab (struct symtab *);
 
+extern char **default_make_symbol_completion_list (char *, char *);
 extern char **make_symbol_completion_list (char *, char *);
 
 extern char **make_file_symbol_completion_list (char *, char *, char *);
@@ -1316,10 +1315,15 @@ extern char **make_source_files_completion_list (char *, char *);
 
 /* 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 CORE_ADDR find_function_start_pc (struct gdbarch *,
+                                        CORE_ADDR, asection *);
+
 extern struct symtab_and_line find_function_start_sal (struct symbol *sym,
                                                       int);
 
@@ -1380,9 +1384,14 @@ extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search
 extern void set_main_name (const char *name);
 extern /*const */ char *main_name (void);
 
-/* Global to indicate presence of HP-compiled objects,
-   in particular, SOM executable file with SOM debug info 
-   Defined in symtab.c, used in hppa-tdep.c. */
-extern int deprecated_hp_som_som_object_present;
+/* Check global symbols in objfile.  */
+struct symbol *lookup_global_symbol_from_objfile (const struct objfile *objfile,
+                                                 const char *name,
+                                                 const char *linkage_name,
+                                                 const domain_enum domain,
+                                                 struct symtab **symtab);
+
+extern struct symtabs_and_lines
+expand_line_sal (struct symtab_and_line sal);
 
 #endif /* !defined(SYMTAB_H) */
This page took 0.028288 seconds and 4 git commands to generate.