2001-04-03 David Mosberger <davidm@hpl.hp.com>
[deliverable/binutils-gdb.git] / gdb / symtab.h
index 55db0f82a9d486086e058bf9a0798b6b9dea789a..a4f224d68725d1976118fe28907e2bb3960a6458 100644 (file)
@@ -1,5 +1,6 @@
 /* Symbol table definitions for GDB.
-   Copyright 1986, 89, 91, 92, 93, 94, 95, 96, 1998
+   Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+   1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -26,7 +27,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
@@ -170,6 +171,8 @@ extern CORE_ADDR symbol_overlayed_address (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 +183,7 @@ extern CORE_ADDR symbol_overlayed_address (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 +200,7 @@ extern CORE_ADDR symbol_overlayed_address (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 +218,13 @@ extern CORE_ADDR symbol_overlayed_address (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
@@ -763,7 +762,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
   {
@@ -830,8 +829,9 @@ struct section_offsets
   };
 
 #define        ANOFFSET(secoff, whichone) \
-   ((whichone == -1) ? \
-    (internal_error ("Section index is uninitialized"), -1) : secoff->offsets[whichone])
+   ((whichone == -1) \
+    ? (internal_error (__FILE__, __LINE__, "Section index is uninitialized"), -1) \
+    : secoff->offsets[whichone])
 
 /* The maximum possible size of a section_offsets table.  */
 
@@ -1047,13 +1047,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).
@@ -1351,9 +1347,6 @@ extern struct symtabs_and_lines decode_line_spec (char *, int);
 
 extern struct symtabs_and_lines decode_line_spec_1 (char *, int);
 
-extern struct symtabs_and_lines
-decode_line_1 (char **, int, struct symtab *, int, char ***);
-
 /* Symmisc.c */
 
 void maintenance_print_symbols (char *, int);
@@ -1396,6 +1389,10 @@ extern struct symbol **make_symbol_overload_list (struct symbol *);
 
 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 (CORE_ADDR, int *);
@@ -1423,7 +1420,7 @@ extern struct partial_symbol *fixup_psymbol_section (struct partial_symbol
 /* 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,
This page took 0.024969 seconds and 4 git commands to generate.