* configure.ac (mips*-*-*linux*, mips*-*-gnu*): Use mt-mips-gnu.
[deliverable/binutils-gdb.git] / gdb / symtab.h
index 90e5b5ee1abfee6c07656aa0f5bb51ca023cda50..ae4faf5d2250b3e195ba1d338ea64e47e1ee39e5 100644 (file)
@@ -1,7 +1,7 @@
 /* Symbol table definitions for GDB.
 
    Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
+   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -157,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.  */
 
@@ -182,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,
@@ -431,7 +426,13 @@ enum address_class
 
   LOC_STATIC,
 
-  /* Value is in register.  SYMBOL_VALUE is the register number.  */
+  /* Value is in register.  SYMBOL_VALUE is the register number.
+
+     For some symbol formats (stabs, for some compilers at least),
+     the compiler generates two symbols, an argument and a register.
+     In some cases we combine them to a single LOC_REGISTER in symbol
+     reading, but currently not for all cases (e.g. it's passed on the
+     stack and then loaded into a register).  */
 
   LOC_REGISTER,
 
@@ -443,22 +444,7 @@ enum address_class
 
   LOC_REF_ARG,
 
-  /* Value is in register number SYMBOL_VALUE.  Just like LOC_REGISTER
-     except this is an argument.  Probably the cleaner way to handle
-     this would be to separate address_class (which would include
-     separate ARG and LOCAL to deal with the frame's arguments
-     (get_frame_args_address) versus the frame's locals
-     (get_frame_locals_address), and an is_argument flag.
-
-     For some symbol formats (stabs, for some compilers at least),
-     the compiler generates two symbols, an argument and a register.
-     In some cases we combine them to a single LOC_REGPARM in symbol
-     reading, but currently not for all cases (e.g. it's passed on the
-     stack and then loaded into a register).  */
-
-  LOC_REGPARM,
-
-  /* Value is in specified register.  Just like LOC_REGPARM except the
+  /* Value is in specified register.  Just like LOC_REGISTER except the
      register holds the address of the argument instead of the argument
      itself. This is currently used for the passing of structs and unions
      on sparc and hppa.  It is also used for call by reference where the
@@ -490,33 +476,6 @@ enum address_class
 
   LOC_CONST_BYTES,
 
-  /* Value is arg at SYMBOL_VALUE offset in stack frame. Differs from
-     LOC_LOCAL in that symbol is an argument; differs from LOC_ARG in
-     that we find it in the frame (get_frame_locals_address), not in
-     the arglist (get_frame_args_address).  Added for i960, which
-     passes args in regs then copies to frame.  */
-
-  LOC_LOCAL_ARG,
-
-  /* Value is at SYMBOL_VALUE offset from the current value of
-     register number SYMBOL_BASEREG.  This exists mainly for the same
-     things that LOC_LOCAL and LOC_ARG do; but we need to do this
-     instead because on 88k DWARF gives us the offset from the
-     frame/stack pointer, rather than the offset from the "canonical
-     frame address" used by COFF, stabs, etc., and we don't know how
-     to convert between these until we start examining prologues.
-
-     Note that LOC_BASEREG is much less general than a DWARF expression.
-     We don't need the generality (at least not yet), and storing a general
-     DWARF expression would presumably take up more space than the existing
-     scheme.  */
-
-  LOC_BASEREG,
-
-  /* Same as LOC_BASEREG but it is an argument.  */
-
-  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.
@@ -529,32 +488,14 @@ enum address_class
 
   LOC_UNRESOLVED,
 
-  /* Value is at a thread-specific location calculated by a
-     target-specific method. This is used only by hppa.  */
-
-  LOC_HP_THREAD_LOCAL_STATIC,
-
   /* The variable does not actually exist in the program.
      The value is ignored.  */
 
   LOC_OPTIMIZED_OUT,
 
-  /* The variable is static, but actually lives at * (address).
-   * I.e. do an extra indirection to get to it.
-   * This is used on HP-UX to get at globals that are allocated
-   * in shared libraries, where references from images other
-   * than the one where the global was allocated are done
-   * with a level of indirection.
-   */
-
-  LOC_INDIRECT,
-
   /* The variable's address is computed by a set of location
      functions (see "struct symbol_ops" below).  */
   LOC_COMPUTED,
-
-  /* Same as LOC_COMPUTED, but for function arguments.  */
-  LOC_COMPUTED_ARG
 };
 
 /* The methods needed to implement a symbol class.  These methods can
@@ -623,6 +564,10 @@ struct symbol
 
   ENUM_BITFIELD(address_class) aclass : 6;
 
+  /* Whether this is an argument.  */
+
+  unsigned is_argument : 1;
+
   /* Line number of definition.  FIXME:  Should we really make the assumption
      that nobody will try to debug files longer than 64K lines?  What about
      machine generated programs? */
@@ -634,27 +579,20 @@ struct symbol
 
   const struct symbol_ops *ops;
 
-  /* Some symbols require additional information to be recorded on a
-     per- symbol basis.  Stash those values here. */
-
-  union
-  {
-    /* Used by LOC_BASEREG and LOC_BASEREG_ARG.  */
-    short basereg;
-    /* 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
-       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
-       base for this function.  */
-    /* FIXME drow/2003-02-21: For the LOC_BLOCK case, it might be better
-       to add a magic symbol to the block containing this information,
-       or to have a generic debug info annotation slot for symbols.  */
-    void *ptr;
-  }
-  aux_value;
+  /* An arbitrary data pointer, allowing symbol readers to record
+     additional information on a per-symbol basis.  Note that this data
+     must be allocated using the same obstack as the symbol itself.  */
+  /* So far it is only used by LOC_COMPUTED to
+     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
+     base for this function.  */
+  /* FIXME drow/2003-02-21: For the LOC_BLOCK case, it might be better
+     to add a magic symbol to the block containing this information,
+     or to have a generic debug info annotation slot for symbols.  */
+
+  void *aux_value;
 
   struct symbol *hash_next;
 };
@@ -662,13 +600,12 @@ struct symbol
 
 #define SYMBOL_DOMAIN(symbol)  (symbol)->domain
 #define SYMBOL_CLASS(symbol)           (symbol)->aclass
+#define SYMBOL_IS_ARGUMENT(symbol)     (symbol)->is_argument
 #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
+#define SYMBOL_LOCATION_BATON(symbol)   (symbol)->aux_value
 \f
 /* A partial_symbol records the name, domain, and address class of
    symbols whose types we have not parsed yet.  For functions, it also
@@ -809,7 +746,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
@@ -817,7 +753,7 @@ struct symtab
 
   enum free_code
   {
-    free_nothing, free_contents, free_linetable
+    free_nothing, free_linetable
   }
   free_code;
 
@@ -999,25 +935,33 @@ 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) in language */
+/* lookup a symbol by name (optional block) in language.  */
 
 extern struct symbol *lookup_symbol_in_language (const char *,
                                                 const struct block *,
                                                 const domain_enum,
                                                 enum language,
-                                                int *,
-                                                struct symtab **);
+                                                int *);
 
 /* 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 *,
-                                    struct symtab **);
+                                    const domain_enum, int *);
 
 /* A default version of lookup_symbol_nonlocal for use by languages
    that can't think of anything better to do.  */
@@ -1025,8 +969,7 @@ extern struct symbol *lookup_symbol (const char *, const struct block *,
 extern struct symbol *basic_lookup_symbol_nonlocal (const char *,
                                                    const char *,
                                                    const struct block *,
-                                                   const domain_enum,
-                                                   struct symtab **);
+                                                   const domain_enum);
 
 /* Some helper functions for languages that need to write their own
    lookup_symbol_nonlocal functions.  */
@@ -1037,8 +980,7 @@ extern struct symbol *basic_lookup_symbol_nonlocal (const char *,
 extern struct symbol *lookup_symbol_static (const char *name,
                                            const char *linkage_name,
                                            const struct block *block,
-                                           const domain_enum domain,
-                                           struct symtab **symtab);
+                                           const domain_enum domain);
 
 /* Lookup a symbol in all files' global blocks (searching psymtabs if
    necessary).  */
@@ -1046,8 +988,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);
+                                           const domain_enum domain);
 
 /* Lookup a symbol within the block BLOCK.  This, unlike
    lookup_symbol_block, will set SYMTAB and BLOCK_FOUND correctly, and
@@ -1056,8 +997,7 @@ extern struct symbol *lookup_symbol_global (const char *name,
 extern struct symbol *lookup_symbol_aux_block (const char *name,
                                               const char *linkage_name,
                                               const struct block *block,
-                                              const domain_enum domain,
-                                              struct symtab **symtab);
+                                              const domain_enum domain);
 
 /* Lookup a partial symbol.  */
 
@@ -1163,6 +1103,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);
@@ -1178,6 +1120,9 @@ struct minimal_symbol *lookup_minimal_symbol_solib_trampoline (const char *,
                                                               struct objfile
                                                               *);
 
+extern struct minimal_symbol *lookup_minimal_symbol_by_pc_name
+                               (CORE_ADDR, const char *, struct objfile *);
+
 extern struct minimal_symbol *lookup_minimal_symbol_by_pc (CORE_ADDR);
 
 extern struct minimal_symbol *lookup_minimal_symbol_by_pc_section (CORE_ADDR,
@@ -1236,27 +1181,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
@@ -1322,6 +1246,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 *);
@@ -1336,6 +1261,9 @@ 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);
 
@@ -1400,8 +1328,7 @@ extern /*const */ char *main_name (void);
 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);
+                                                 const domain_enum domain);
 
 extern struct symtabs_and_lines
 expand_line_sal (struct symtab_and_line sal);
This page took 0.046868 seconds and 4 git commands to generate.