2004-01-26 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / symtab.h
index 3723559cbc3bb8a6df6480203314db1f2cc85f79..c56c05366d37aa3412d30cee2a3b884a8ad37ef8 100644 (file)
@@ -1,7 +1,7 @@
 /* Symbol table definitions for GDB.
 
    Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
    Foundation, Inc.
 
    This file is part of GDB.
@@ -325,6 +325,12 @@ struct minimal_symbol
 
   char *info;
 
+  /* Size of this symbol.  end_psymtab in dbxread.c uses this
+     information to calculate the end of the partial symtab based on the
+     address of the last symbol plus the size of the last symbol.  */
+
+  unsigned long size;
+
 #ifdef SOFUN_ADDRESS_MAYBE_MISSING
   /* Which source file is this symbol in?  Only relevant for mst_file_*.  */
   char *filename;
@@ -346,6 +352,7 @@ struct minimal_symbol
 };
 
 #define MSYMBOL_INFO(msymbol)          (msymbol)->info
+#define MSYMBOL_SIZE(msymbol)          (msymbol)->size
 #define MSYMBOL_TYPE(msymbol)          (msymbol)->type
 
 \f
@@ -539,21 +546,12 @@ enum address_class
   LOC_COMPUTED_ARG
 };
 
-/* A structure of function pointers describing the location of a
-   variable, structure member, or structure base class.
-
-   These functions' BATON arguments are generic data pointers, holding
-   whatever data the functions need --- the code which provides this
-   structure also provides the actual contents of the baton, and
-   decides its form.  However, there may be other rules about where
-   the baton data must be allocated; whoever is pointing to this
-   `struct location_funcs' object will know the rules.  For example,
-   when a symbol S's location is LOC_COMPUTED, then
-   SYMBOL_LOCATION_FUNCS(S) is pointing to a location_funcs structure,
-   and SYMBOL_LOCATION_BATON(S) is the baton, which must be allocated
-   on the same obstack as the symbol itself.  */
-
-struct location_funcs
+/* The methods needed to implement a symbol class.  These methods can
+   use the symbol's .aux_value for additional per-symbol information.
+
+   At present this is only used to implement location expressions.  */
+
+struct symbol_ops
 {
 
   /* Return the value of the variable SYMBOL, relative to the stack
@@ -583,22 +581,6 @@ struct location_funcs
                              struct axs_value * value);
 };
 
-/* Linked list of symbol's live ranges. */
-
-struct range_list
-{
-  CORE_ADDR start;
-  CORE_ADDR end;
-  struct range_list *next;
-};
-
-/* Linked list of aliases for a particular main/primary symbol.  */
-struct alias_list
-{
-  struct symbol *sym;
-  struct alias_list *next;
-};
-
 /* This structure is space critical.  See space comments at the top. */
 
 struct symbol
@@ -617,6 +599,12 @@ struct symbol
   ENUM_BITFIELD(domain_enum_tag) domain : 6;
 
   /* Address class */
+  /* NOTE: cagney/2003-11-02: The fields "aclass" and "ops" contain
+     overlapping information.  By creating a per-aclass ops vector, or
+     using the aclass as an index into an ops table, the aclass and
+     ops fields can be merged.  The latter, for instance, would shave
+     32-bits from each symbol (relative to a symbol lookup, any table
+     index overhead would be in the noise).  */
 
   ENUM_BITFIELD(address_class) aclass : 6;
 
@@ -626,40 +614,33 @@ struct symbol
 
   unsigned short line;
 
-  /* Some symbols require an additional value to be recorded on a per-
-     symbol basis.  Stash those values here. */
+  /* Method's for symbol's of this class.  */
+  /* NOTE: cagney/2003-11-02: See comment above attached to "aclass".  */
+
+  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;
-
-    /* For a LOC_COMPUTED or LOC_COMPUTED_ARG symbol, this is the
-       baton and location_funcs structure to find its location.  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.  */
+    /* 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.  */
-    struct
-    {
-      void *baton;
-      struct location_funcs *funcs;
-    } loc;
+    void *ptr;
   }
   aux_value;
 
-
-  /* Link to a list of aliases for this symbol.
-     Only a "primary/main symbol may have aliases.  */
-  struct alias_list *aliases;
-
-  /* List of ranges where this symbol is active.  This is only
-     used by alias symbols at the current time.  */
-  struct range_list *ranges;
-
   struct symbol *hash_next;
 };
 
@@ -670,10 +651,8 @@ struct symbol
 #define SYMBOL_LINE(symbol)            (symbol)->line
 #define SYMBOL_BASEREG(symbol)         (symbol)->aux_value.basereg
 #define SYMBOL_OBJFILE(symbol)          (symbol)->aux_value.objfile
-#define SYMBOL_ALIASES(symbol)         (symbol)->aliases
-#define SYMBOL_RANGES(symbol)          (symbol)->ranges
-#define SYMBOL_LOCATION_BATON(symbol)   (symbol)->aux_value.loc.baton
-#define SYMBOL_LOCATION_FUNCS(symbol)   (symbol)->aux_value.loc.funcs
+#define SYMBOL_OPS(symbol)              (symbol)->ops
+#define SYMBOL_LOCATION_BATON(symbol)   (symbol)->aux_value.ptr
 \f
 /* A partial_symbol records the name, domain, and address class of
    symbols whose types we have not parsed yet.  For functions, it also
@@ -1127,6 +1106,7 @@ extern int find_pc_line_pc_range (CORE_ADDR, CORE_ADDR *, CORE_ADDR *);
 extern void reread_symbols (void);
 
 extern struct type *lookup_transparent_type (const char *);
+extern struct type *basic_lookup_transparent_type (const char *);
 
 
 /* Macro for name of symbol to indicate a file compiled with gcc. */
@@ -1164,7 +1144,6 @@ extern struct minimal_symbol *lookup_minimal_symbol (const char *,
                                                     struct objfile *);
 
 extern struct minimal_symbol *lookup_minimal_symbol_text (const char *,
-                                                         const char *,
                                                          struct objfile *);
 
 struct minimal_symbol *lookup_minimal_symbol_solib_trampoline (const char *,
This page took 0.026905 seconds and 4 git commands to generate.