* NEWS: Add entry for stdio gdbserver.
[deliverable/binutils-gdb.git] / gdb / symtab.h
index 59bbe2450f380ba25260454047b79921d4e16184..7b52c8812f9c4c01ab40f95fc7442cee3c59d598 100644 (file)
@@ -22,6 +22,8 @@
 #if !defined (SYMTAB_H)
 #define SYMTAB_H 1
 
+#include "vec.h"
+
 /* Opaque declarations.  */
 struct ui_file;
 struct frame_info;
@@ -33,6 +35,7 @@ struct blockvector;
 struct axs_value;
 struct agent_expr;
 struct program_space;
+struct language_defn;
 
 /* Some of the structures in this file are space critical.
    The space-critical structures are:
@@ -243,11 +246,14 @@ extern char *symbol_demangled_name (const struct general_symbol_info *symbol);
    name if demangle is on and the "mangled" form of the name if
    demangle is off.  In other languages this is just the symbol name.
    The result should never be NULL.  Don't use this for internal
-   purposes (e.g. storing in a hashtable): it's only suitable for
-   output.  */
+   purposes (e.g. storing in a hashtable): it's only suitable for output.
+
+   N.B. symbol may be anything with a ginfo member,
+   e.g., struct symbol or struct minimal_symbol.  */
 
 #define SYMBOL_PRINT_NAME(symbol)                                      \
   (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol))
+extern int demangle;
 
 /* Macro that tests a symbol for a match against a specified name string.
    First test the unencoded name, then looks for and test a C++ encoded
@@ -398,19 +404,23 @@ typedef enum domain_enum_tag
   LABEL_DOMAIN
 } domain_enum;
 
-/* Searching domains, used for `search_symbols'.  */
+/* Searching domains, used for `search_symbols'.  Element numbers are
+   hardcoded in GDB, check all enum uses before changing it.  */
 
 enum search_domain
 {
   /* Everything in VAR_DOMAIN minus FUNCTIONS_DOMAIN and
      TYPES_DOMAIN.  */
-  VARIABLES_DOMAIN,
+  VARIABLES_DOMAIN = 0,
 
   /* All functions -- for some reason not methods, though.  */
-  FUNCTIONS_DOMAIN,
+  FUNCTIONS_DOMAIN = 1,
 
   /* All defined types */
-  TYPES_DOMAIN
+  TYPES_DOMAIN = 2,
+
+  /* Any type.  */
+  ALL_DOMAIN = 3
 };
 
 /* An address-class says where to find the value of a symbol.  */
@@ -528,6 +538,12 @@ struct symbol_computed_ops
   struct value *(*read_variable) (struct symbol * symbol,
                                  struct frame_info * frame);
 
+  /* Read variable SYMBOL like read_variable at (callee) FRAME's function
+     entry.  SYMBOL should be a function parameter, otherwise
+     NO_ENTRY_VALUE_ERROR will be thrown.  */
+  struct value *(*read_variable_at_entry) (struct symbol *symbol,
+                                          struct frame_info *frame);
+
   /* Return non-zero if we need a frame to find the value of the SYMBOL.  */
   int (*read_needs_frame) (struct symbol * symbol);
 
@@ -766,7 +782,18 @@ struct symtab
      should be designated the primary, so that the blockvector
      is relocated exactly once by objfile_relocate.  */
 
-  int primary;
+  unsigned int primary : 1;
+
+  /* Symtab has been compiled with both optimizations and debug info so that
+     GDB may stop skipping prologues as variables locations are valid already
+     at function entry points.  */
+
+  unsigned int locations_valid : 1;
+
+  /* DWARF unwinder for this CU is valid even for epilogues (PC at the return
+     instruction).  This is supported by GCC since 4.5.0.  */
+
+  unsigned int epilogue_unwind_valid : 1;
 
   /* The macro table for this symtab.  Like the blockvector, this
      may be shared between different symtabs --- and normally is for
@@ -815,6 +842,9 @@ struct symtab
 
   struct objfile *objfile;
 
+  /* struct call_site entries for this compilation unit or NULL.  */
+
+  htab_t call_site_htab;
 };
 
 #define BLOCKVECTOR(symtab)    (symtab)->blockvector
@@ -837,18 +867,10 @@ struct symtab
 
 /* External variables and functions for the objects described above.  */
 
-/* See the comment in symfile.c about how current_objfile is used.  */
-
-extern struct objfile *current_objfile;
-
 /* True if we are nested inside psymtab_to_symtab.  */
 
 extern int currently_reading_symtab;
 
-/* From utils.c.  */
-extern int demangle;
-extern int asm_demangle;
-
 /* symtab.c lookup functions */
 
 extern const char multiple_symbols_ask[];
@@ -911,6 +933,9 @@ extern struct symbol *lookup_symbol_aux_block (const char *name,
                                               const struct block *block,
                                               const domain_enum domain);
 
+extern struct symbol *lookup_language_this (const struct language_defn *lang,
+                                           const struct block *block);
+
 /* Lookup a symbol only in the file static scope of all the objfiles.  */
 
 struct symbol *lookup_static_symbol_aux (const char *name,
@@ -924,11 +949,11 @@ extern struct symbol *lookup_block_symbol (const struct block *, const char *,
 
 /* lookup a [struct, union, enum] by name, within a specified block.  */
 
-extern struct type *lookup_struct (char *, struct block *);
+extern struct type *lookup_struct (const char *, struct block *);
 
-extern struct type *lookup_union (char *, struct block *);
+extern struct type *lookup_union (const char *, struct block *);
 
-extern struct type *lookup_enum (char *, struct block *);
+extern struct type *lookup_enum (const char *, struct block *);
 
 /* from blockframe.c: */
 
@@ -1004,6 +1029,13 @@ extern unsigned int msymbol_hash_iw (const char *);
 
 extern unsigned int msymbol_hash (const char *);
 
+/* Compute the next hash value from previous HASH and the character C.  This
+   is only a GDB in-memory computed value with no external files compatibility
+   requirements.  */
+
+#define SYMBOL_HASH_NEXT(hash, c) \
+  ((hash) * 67 + tolower ((unsigned char) (c)) - 113)
+
 extern struct objfile * msymbol_objfile (struct minimal_symbol *sym);
 
 extern void
@@ -1026,6 +1058,12 @@ extern struct minimal_symbol *lookup_minimal_symbol_by_pc_name
 
 extern struct minimal_symbol *lookup_minimal_symbol_by_pc (CORE_ADDR);
 
+extern void iterate_over_minimal_symbols (struct objfile *objf,
+                                         const char *name,
+                                         void (*callback) (struct minimal_symbol *,
+                                                           void *),
+                                         void *user_data);
+
 extern int in_gnu_ifunc_stub (CORE_ADDR pc);
 
 /* Functions for resolving STT_GNU_IFUNC symbols which are implemented only
@@ -1265,8 +1303,6 @@ struct symbol *lookup_global_symbol_from_objfile (const struct objfile *,
                                                  const char *name,
                                                  const domain_enum domain);
 
-extern struct symtabs_and_lines expand_line_sal (struct symtab_and_line sal);
-
 /* Return 1 if the supplied producer string matches the ARM RealView
    compiler (armcc).  */
 int producer_is_realview (const char *producer);
@@ -1276,4 +1312,33 @@ void fixup_section (struct general_symbol_info *ginfo,
 
 struct objfile *lookup_objfile_from_block (const struct block *block);
 
+extern int basenames_may_differ;
+
+int iterate_over_some_symtabs (const char *name,
+                              const char *full_path,
+                              const char *real_path,
+                              int (*callback) (struct symtab *symtab,
+                                               void *data),
+                              void *data,
+                              struct symtab *first,
+                              struct symtab *after_last);
+
+void iterate_over_symtabs (const char *name,
+                          int (*callback) (struct symtab *symtab,
+                                           void *data),
+                          void *data);
+
+DEF_VEC_I (CORE_ADDR);
+
+VEC (CORE_ADDR) *find_pcs_for_symtab_line (struct symtab *symtab, int line,
+                                          struct linetable_entry **best_entry);
+
+void iterate_over_symbols (const struct block *block, const char *name,
+                          const domain_enum domain,
+                          int (*callback) (struct symbol *, void *),
+                          void *data);
+
+struct cleanup *demangle_for_lookup (const char *name, enum language lang,
+                                    const char **result_name);
+
 #endif /* !defined(SYMTAB_H) */
This page took 0.029938 seconds and 4 git commands to generate.