GDB (xrefs)
Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-7.10/gdb/symtab.c File Reference
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "gdbcore.h"
#include "frame.h"
#include "target.h"
#include "value.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdbcmd.h"
#include "gdb_regex.h"
#include "expression.h"
#include "language.h"
#include "demangle.h"
#include "inferior.h"
#include "source.h"
#include "filenames.h"
#include "objc-lang.h"
#include "d-lang.h"
#include "ada-lang.h"
#include "go-lang.h"
#include "p-lang.h"
#include "addrmap.h"
#include "cli/cli-utils.h"
#include "hashtab.h"
#include "gdb_obstack.h"
#include "block.h"
#include "dictionary.h"
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <ctype.h>
#include "cp-abi.h"
#include "cp-support.h"
#include "observer.h"
#include "solist.h"
#include "macrotab.h"
#include "macroscope.h"
#include "parser-defs.h"
#include "completer.h"

Go to the source code of this file.

Classes

struct  main_info
 
struct  symbol_cache_slot
 
struct  block_symbol_cache
 
struct  symbol_cache
 
struct  demangled_name_entry
 
struct  global_sym_lookup_data
 
struct  filename_seen_cache
 
struct  output_source_filename_data
 
struct  search_symbols_data
 
struct  add_name_data
 
struct  add_partial_filename_data
 

Macros

#define DEFAULT_SYMBOL_CACHE_SIZE   1021
 
#define MAX_SYMBOL_CACHE_SIZE   (1024*1024)
 
#define SYMBOL_LOOKUP_FAILED   ((struct symbol *) 1)
 
#define JAVA_PREFIX   "##JAVA$$"
 
#define JAVA_PREFIX_LEN   8
 
#define INITIAL_FILENAME_SEEN_CACHE_SIZE   100
 
#define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word)
 
#define MCOMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word)
 
#define MAX_SYMBOL_IMPLS   (LOC_FINAL_VALUE + 10)
 

Enumerations

enum  symbol_cache_slot_state { SYMBOL_SLOT_UNUSED, SYMBOL_SLOT_NOT_FOUND, SYMBOL_SLOT_FOUND }
 

Functions

static void rbreak_command (char *, int)
 
static int find_line_common (struct linetable *, int, int *, int)
 
static struct symbollookup_symbol_aux (const char *name, const struct block *block, const domain_enum domain, enum language language, struct field_of_this_result *)
 
static struct symbollookup_local_symbol (const char *name, const struct block *block, const domain_enum domain, enum language language)
 
static struct symbollookup_symbol_in_objfile (struct objfile *objfile, int block_index, const char *name, const domain_enum domain)
 
const char * multiple_symbols_select_mode (void)
 
const char * domain_name (domain_enum e)
 
const char * search_domain_name (enum search_domain e)
 
struct symtabcompunit_primary_filetab (const struct compunit_symtab *cust)
 
enum language compunit_language (const struct compunit_symtab *cust)
 
int compare_filenames_for_search (const char *filename, const char *search_name)
 
int iterate_over_some_symtabs (const char *name, const char *real_path, int(*callback)(struct symtab *symtab, void *data), void *data, struct compunit_symtab *first, struct compunit_symtab *after_last)
 
void iterate_over_symtabs (const char *name, int(*callback)(struct symtab *symtab, void *data), void *data)
 
static int lookup_symtab_callback (struct symtab *symtab, void *data)
 
struct symtablookup_symtab (const char *name)
 
char * gdb_mangle_name (struct type *type, int method_id, int signature_id)
 
void symbol_set_demangled_name (struct general_symbol_info *gsymbol, const char *name, struct obstack *obstack)
 
const char * symbol_get_demangled_name (const struct general_symbol_info *gsymbol)
 
void symbol_set_language (struct general_symbol_info *gsymbol, enum language language, struct obstack *obstack)
 
static hashval_t hash_demangled_name_entry (const void *data)
 
static int eq_demangled_name_entry (const void *a, const void *b)
 
static void create_demangled_names_hash (struct objfile *objfile)
 
static char * symbol_find_demangled_name (struct general_symbol_info *gsymbol, const char *mangled)
 
void symbol_set_names (struct general_symbol_info *gsymbol, const char *linkage_name, int len, int copy_name, struct objfile *objfile)
 
const char * symbol_natural_name (const struct general_symbol_info *gsymbol)
 
const char * symbol_demangled_name (const struct general_symbol_info *gsymbol)
 
const char * symbol_search_name (const struct general_symbol_info *gsymbol)
 
void init_sal (struct symtab_and_line *sal)
 
int matching_obj_sections (struct obj_section *obj_first, struct obj_section *obj_second)
 
void expand_symtab_containing_pc (CORE_ADDR pc, struct obj_section *section)
 
static unsigned int hash_symbol_entry (const struct objfile *objfile_context, const char *name, domain_enum domain)
 
static int eq_symbol_entry (const struct symbol_cache_slot *slot, const struct objfile *objfile_context, const char *name, domain_enum domain)
 
static size_t symbol_cache_byte_size (unsigned int size)
 
static void resize_symbol_cache (struct symbol_cache *cache, unsigned int new_size)
 
static struct symbol_cachemake_symbol_cache (unsigned int size)
 
static void free_symbol_cache (struct symbol_cache *cache)
 
static struct symbol_cacheget_symbol_cache (struct program_space *pspace)
 
static void symbol_cache_cleanup (struct program_space *pspace, void *data)
 
static void set_symbol_cache_size (unsigned int new_size)
 
static void set_symbol_cache_size_handler (char *args, int from_tty, struct cmd_list_element *c)
 
static struct symbolsymbol_cache_lookup (struct symbol_cache *cache, struct objfile *objfile_context, int block, const char *name, domain_enum domain, struct block_symbol_cache **bsc_ptr, struct symbol_cache_slot **slot_ptr)
 
static void symbol_cache_clear_slot (struct symbol_cache_slot *slot)
 
static void symbol_cache_mark_found (struct block_symbol_cache *bsc, struct symbol_cache_slot *slot, struct objfile *objfile_context, struct symbol *symbol)
 
static void symbol_cache_mark_not_found (struct block_symbol_cache *bsc, struct symbol_cache_slot *slot, struct objfile *objfile_context, const char *name, domain_enum domain)
 
static void symbol_cache_flush (struct program_space *pspace)
 
static void symbol_cache_dump (const struct symbol_cache *cache)
 
static void maintenance_print_symbol_cache (char *args, int from_tty)
 
static void maintenance_flush_symbol_cache (char *args, int from_tty)
 
static void symbol_cache_stats (struct symbol_cache *cache)
 
static void maintenance_print_symbol_cache_statistics (char *args, int from_tty)
 
static void symtab_new_objfile_observer (struct objfile *objfile)
 
static void symtab_free_objfile_observer (struct objfile *objfile)
 
void fixup_section (struct general_symbol_info *ginfo, CORE_ADDR addr, struct objfile *objfile)
 
struct symbolfixup_symbol_section (struct symbol *sym, struct objfile *objfile)
 
struct cleanupdemangle_for_lookup (const char *name, enum language lang, const char **result_name)
 
struct symbollookup_symbol_in_language (const char *name, const struct block *block, const domain_enum domain, enum language lang, struct field_of_this_result *is_a_field_of_this)
 
struct symbollookup_symbol (const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
 
struct symbollookup_language_this (const struct language_defn *lang, const struct block *block)
 
static int check_field (struct type *type, const char *name, struct field_of_this_result *is_a_field_of_this)
 
static struct symbollookup_symbol_aux (const char *name, const struct block *block, const domain_enum domain, enum language language, struct field_of_this_result *is_a_field_of_this)
 
static struct symbollookup_local_symbol (const char *name, const struct block *block, const domain_enum domain, enum language language)
 
struct objfilelookup_objfile_from_block (const struct block *block)
 
struct symbollookup_symbol_in_block (const char *name, const struct block *block, const domain_enum domain)
 
struct symbollookup_global_symbol_from_objfile (struct objfile *main_objfile, const char *name, const domain_enum domain)
 
static struct symbollookup_symbol_in_objfile_symtabs (struct objfile *objfile, int block_index, const char *name, const domain_enum domain)
 
static struct symbollookup_symbol_in_objfile_from_linkage_name (struct objfile *objfile, const char *linkage_name, domain_enum domain)
 
static void ATTRIBUTE_NORETURN error_in_psymtab_expansion (int block_index, const char *name, struct compunit_symtab *cust)
 
static struct symbollookup_symbol_via_quick_fns (struct objfile *objfile, int block_index, const char *name, const domain_enum domain)
 
struct symbolbasic_lookup_symbol_nonlocal (const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
 
struct symbollookup_symbol_in_static_block (const char *name, const struct block *block, const domain_enum domain)
 
struct symbollookup_static_symbol (const char *name, const domain_enum domain)
 
static int lookup_symbol_global_iterator_cb (struct objfile *objfile, void *cb_data)
 
struct symbollookup_global_symbol (const char *name, const struct block *block, const domain_enum domain)
 
int symbol_matches_domain (enum language symbol_language, domain_enum symbol_domain, domain_enum domain)
 
struct typelookup_transparent_type (const char *name)
 
static struct typebasic_lookup_transparent_type_quick (struct objfile *objfile, int block_index, const char *name)
 
static struct typebasic_lookup_transparent_type_1 (struct objfile *objfile, int block_index, const char *name)
 
struct typebasic_lookup_transparent_type (const char *name)
 
void iterate_over_symbols (const struct block *block, const char *name, const domain_enum domain, symbol_found_callback_ftype *callback, void *data)
 
struct compunit_symtabfind_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
 
struct compunit_symtabfind_pc_compunit_symtab (CORE_ADDR pc)
 
struct symtab_and_line find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
 
struct symtab_and_line find_pc_line (CORE_ADDR pc, int notcurrent)
 
struct symtabfind_pc_line_symtab (CORE_ADDR pc)
 
struct symtabfind_line_symtab (struct symtab *symtab, int line, int *index, int *exact_match)
 
 VEC (CORE_ADDR)
 
int find_line_pc (struct symtab *symtab, int line, CORE_ADDR *pc)
 
int find_line_pc_range (struct symtab_and_line sal, CORE_ADDR *startptr, CORE_ADDR *endptr)
 
int find_pc_line_pc_range (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
 
struct symtab_and_line find_function_start_sal (struct symbol *sym, int funfirstline)
 
static CORE_ADDR skip_prologue_using_lineinfo (CORE_ADDR func_addr, struct symtab *symtab)
 
void skip_prologue_sal (struct symtab_and_line *sal)
 
CORE_ADDR skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr)
 
static const char * operator_chars (const char *p, const char **end)
 
static struct filename_seen_cachecreate_filename_seen_cache (void)
 
static void clear_filename_seen_cache (struct filename_seen_cache *cache)
 
static void delete_filename_seen_cache (void *ptr)
 
static int filename_seen (struct filename_seen_cache *cache, const char *file, int add)
 
static void output_source_filename (const char *name, struct output_source_filename_data *data)
 
static void output_partial_symbol_filename (const char *filename, const char *fullname, void *data)
 
static void sources_info (char *ignore, int from_tty)
 
static int file_matches (const char *file, const char *files[], int nfiles, int basenames)
 
void free_search_symbols (struct symbol_search *symbols)
 
static void do_free_search_symbols_cleanup (void *symbolsp)
 
struct cleanupmake_cleanup_free_search_symbols (struct symbol_search **symbolsp)
 
static int compare_search_syms (const void *sa, const void *sb)
 
static void sort_search_symbols_remove_dups (struct symbol_search *found, int nfound, struct symbol_search **new_head, struct symbol_search **new_tail)
 
static int search_symbols_file_matches (const char *filename, void *user_data, int basenames)
 
static int search_symbols_name_matches (const char *symname, void *user_data)
 
void search_symbols (const char *regexp, enum search_domain kind, int nfiles, const char *files[], struct symbol_search **matches)
 
static void print_symbol_info (enum search_domain kind, struct symbol *sym, int block, const char *last)
 
static void print_msymbol_info (struct bound_minimal_symbol msymbol)
 
static void symtab_symbol_info (char *regexp, enum search_domain kind, int from_tty)
 
static void variables_info (char *regexp, int from_tty)
 
static void functions_info (char *regexp, int from_tty)
 
static void types_info (char *regexp, int from_tty)
 
void rbreak_command_wrapper (char *regexp, int from_tty)
 
static void do_end_rbreak_breakpoints (void *ignore)
 
static int compare_symbol_name (const char *name, const char *sym_text, int sym_text_len)
 
static void free_completion_list (VEC(char_ptr)**list_ptr)
 
static void do_free_completion_list (void *list)
 
static VEC (char_ptr)
 
static void completion_list_objc_symbol (struct minimal_symbol *msymbol, const char *sym_text, int sym_text_len, const char *text, const char *word)
 
static const char * language_search_unquoted_string (const char *text, const char *p)
 
static void completion_list_add_fields (struct symbol *sym, const char *sym_text, int sym_text_len, const char *text, const char *word)
 
static void add_macro_name (const char *name, const struct macro_definition *ignore, struct macro_source_file *ignore2, int ignore3, void *user_data)
 
static int symbol_completion_matcher (const char *name, void *user_data)
 
static void add_symtab_completions (struct compunit_symtab *cust, const char *sym_text, int sym_text_len, const char *text, const char *word, enum type_code code)
 
static void symtab_expansion_callback (struct compunit_symtab *symtab, void *user_data)
 
static void default_make_symbol_completion_list_break_on_1 (const char *text, const char *word, const char *break_on, enum type_code code)
 
static void add_filename_to_list (const char *fname, const char *text, const char *word, VEC(char_ptr)**list)
 
static int not_interesting_fname (const char *fname)
 
static void maybe_add_partial_symtab_filename (const char *filename, const char *fullname, void *user_data)
 
static struct main_infoget_main_info (void)
 
static void main_info_cleanup (struct program_space *pspace, void *data)
 
static void set_main_name (const char *name, enum language lang)
 
static void find_main_name (void)
 
char * main_name (void)
 
enum language main_language (void)
 
static void symtab_observer_executable_changed (void)
 
int producer_is_realview (const char *producer)
 
 gdb_static_assert (MAX_SYMBOL_IMPLS<=(1<< SYMBOL_ACLASS_BITS))
 
int register_symbol_computed_impl (enum address_class aclass, const struct symbol_computed_ops *ops)
 
int register_symbol_block_impl (enum address_class aclass, const struct symbol_block_ops *ops)
 
int register_symbol_register_impl (enum address_class aclass, const struct symbol_register_ops *ops)
 
static void initialize_ordinary_address_classes (void)
 
static void initialize_objfile_symbol_1 (struct symbol *sym)
 
void initialize_objfile_symbol (struct symbol *sym)
 
struct symbolallocate_symbol (struct objfile *objfile)
 
struct template_symbolallocate_template_symbol (struct objfile *objfile)
 
struct objfilesymbol_objfile (const struct symbol *symbol)
 
struct gdbarchsymbol_arch (const struct symbol *symbol)
 
struct symtabsymbol_symtab (const struct symbol *symbol)
 
void symbol_set_symtab (struct symbol *symbol, struct symtab *symtab)
 
void _initialize_symtab (void)
 

Variables

initialize_file_ftype _initialize_symtab
 
static const struct program_space_data * main_progspace_key
 
static const struct program_space_data * symbol_cache_key
 
unsigned int symtab_create_debug = 0
 
unsigned int symbol_lookup_debug = 0
 
static unsigned int new_symbol_cache_size = DEFAULT_SYMBOL_CACHE_SIZE
 
static unsigned int symbol_cache_size = DEFAULT_SYMBOL_CACHE_SIZE
 
int basenames_may_differ = 0
 
const char multiple_symbols_ask [] = "ask"
 
const char multiple_symbols_all [] = "all"
 
const char multiple_symbols_cancel [] = "cancel"
 
static const char *const multiple_symbols_modes []
 
static const char * multiple_symbols_mode = multiple_symbols_all
 
const struct blockblock_found
 
static int next_aclass_value = LOC_FINAL_VALUE
 
static struct symbol_impl symbol_impl [MAX_SYMBOL_IMPLS]
 
const struct symbol_implsymbol_impls = &symbol_impl[0]
 

Macro Definition Documentation

#define COMPLETION_LIST_ADD_SYMBOL (   symbol,
  sym_text,
  len,
  text,
  word 
)
Value:
completion_list_add_name \
(SYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))
const char * word
Definition: symtab.h:1448
#define SYMBOL_NATURAL_NAME(symbol)
Definition: symtab.h:231
Definition: symtab.h:703
const ULONGEST const LONGEST len
Definition: target.h:309

Referenced by add_symtab_completions(), and default_make_symbol_completion_list_break_on_1().

#define DEFAULT_SYMBOL_CACHE_SIZE   1021

Definition at line 115 of file symtab.c.

#define INITIAL_FILENAME_SEEN_CACHE_SIZE   100

Definition at line 4124 of file symtab.c.

Referenced by create_filename_seen_cache().

#define JAVA_PREFIX   "##JAVA$$"

Definition at line 847 of file symtab.c.

Referenced by symbol_set_names().

#define JAVA_PREFIX_LEN   8

Definition at line 848 of file symtab.c.

Referenced by symbol_set_names().

#define MAX_SYMBOL_CACHE_SIZE   (1024*1024)

Definition at line 120 of file symtab.c.

Referenced by set_symbol_cache_size_handler().

#define MAX_SYMBOL_IMPLS   (LOC_FINAL_VALUE + 10)
#define MCOMPLETION_LIST_ADD_SYMBOL (   symbol,
  sym_text,
  len,
  text,
  word 
)
Value:
completion_list_add_name \
(MSYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))
const char * word
Definition: symtab.h:1448
#define MSYMBOL_NATURAL_NAME(symbol)
Definition: symtab.h:407
Definition: symtab.h:703
const ULONGEST const LONGEST len
Definition: target.h:309

Referenced by default_make_symbol_completion_list_break_on_1().

#define SYMBOL_LOOKUP_FAILED   ((struct symbol *) 1)

Definition at line 124 of file symtab.c.

Referenced by lookup_global_symbol(), lookup_static_symbol(), and symbol_cache_lookup().

Enumeration Type Documentation

Enumerator
SYMBOL_SLOT_UNUSED 
SYMBOL_SLOT_NOT_FOUND 
SYMBOL_SLOT_FOUND 

Definition at line 129 of file symtab.c.

Function Documentation

void _initialize_symtab ( void  )
static void add_filename_to_list ( const char *  fname,
const char *  text,
const char *  word,
VEC(char_ptr)**  list 
)
static

Definition at line 5729 of file symtab.c.

References VEC_safe_push, word, and xmalloc().

Referenced by maybe_add_partial_symtab_filename().

static void add_macro_name ( const char *  name,
const struct macro_definition ignore,
struct macro_source_file ignore2,
int  ignore3,
void *  user_data 
)
static
static void add_symtab_completions ( struct compunit_symtab cust,
const char *  sym_text,
int  sym_text_len,
const char *  text,
const char *  word,
enum type_code  code 
)
static
struct symbol* allocate_symbol ( struct objfile objfile)
struct template_symbol* allocate_template_symbol ( struct objfile objfile)
struct symbol* basic_lookup_symbol_nonlocal ( const struct language_defn langdef,
const char *  name,
const struct block block,
const domain_enum  domain 
)
struct type* basic_lookup_transparent_type ( const char *  name)
static struct type* basic_lookup_transparent_type_1 ( struct objfile objfile,
int  block_index,
const char *  name 
)
static
static struct type* basic_lookup_transparent_type_quick ( struct objfile objfile,
int  block_index,
const char *  name 
)
static
static int check_field ( struct type type,
const char *  name,
struct field_of_this_result is_a_field_of_this 
)
static
static void clear_filename_seen_cache ( struct filename_seen_cache cache)
static

Definition at line 4145 of file symtab.c.

References filename_seen_cache::tab.

Referenced by sources_info().

int compare_filenames_for_search ( const char *  filename,
const char *  search_name 
)
static int compare_search_syms ( const void *  sa,
const void *  sb 
)
static
static int compare_symbol_name ( const char *  name,
const char *  sym_text,
int  sym_text_len 
)
static

Definition at line 4984 of file symtab.c.

References case_sensitive_on, and int.

Referenced by symbol_completion_matcher(), and VEC().

static void completion_list_add_fields ( struct symbol sym,
const char *  sym_text,
int  sym_text_len,
const char *  text,
const char *  word 
)
static
static void completion_list_objc_symbol ( struct minimal_symbol msymbol,
const char *  sym_text,
int  sym_text_len,
const char *  text,
const char *  word 
)
static

Definition at line 5114 of file symtab.c.

References MSYMBOL_NATURAL_NAME, selector, and xrealloc().

Referenced by default_make_symbol_completion_list_break_on_1().

enum language compunit_language ( const struct compunit_symtab cust)
struct symtab* compunit_primary_filetab ( const struct compunit_symtab cust)
static void create_demangled_names_hash ( struct objfile objfile)
static
static struct filename_seen_cache* create_filename_seen_cache ( void  )
static

Definition at line 4130 of file symtab.c.

References INITIAL_FILENAME_SEEN_CACHE_SIZE, filename_seen_cache::tab, xcalloc(), and xfree().

Referenced by sources_info().

static void default_make_symbol_completion_list_break_on_1 ( const char *  text,
const char *  word,
const char *  break_on,
enum type_code  code 
)
static
static void delete_filename_seen_cache ( void *  ptr)
static

Definition at line 4154 of file symtab.c.

References filename_seen_cache::tab, and xfree().

Referenced by sources_info().

struct cleanup* demangle_for_lookup ( const char *  name,
enum language  lang,
const char **  result_name 
)
static void do_end_rbreak_breakpoints ( void *  ignore)
static

Definition at line 4880 of file symtab.c.

References end_rbreak_breakpoints().

Referenced by rbreak_command().

static void do_free_completion_list ( void *  list)
static

Definition at line 5024 of file symtab.c.

References free_completion_list().

static void do_free_search_symbols_cleanup ( void *  symbolsp)
static

Definition at line 4319 of file symtab.c.

References free_search_symbols().

Referenced by make_cleanup_free_search_symbols().

const char* domain_name ( domain_enum  e)
static int eq_demangled_name_entry ( const void *  a,
const void *  b 
)
static

Definition at line 677 of file symtab.c.

References demangled_name_entry::mangled.

Referenced by create_demangled_names_hash().

static int eq_symbol_entry ( const struct symbol_cache_slot slot,
const struct objfile objfile_context,
const char *  name,
domain_enum  domain 
)
static
static void ATTRIBUTE_NORETURN error_in_psymtab_expansion ( int  block_index,
const char *  name,
struct compunit_symtab cust 
)
static
void expand_symtab_containing_pc ( CORE_ADDR  pc,
struct obj_section section 
)
static int file_matches ( const char *  file,
const char *  files[],
int  nfiles,
int  basenames 
)
static

Definition at line 4284 of file symtab.c.

References compare_filenames_for_search().

Referenced by search_symbols(), and search_symbols_file_matches().

static int filename_seen ( struct filename_seen_cache cache,
const char *  file,
int  add 
)
static

Definition at line 4170 of file symtab.c.

References filename_seen_cache::tab.

Referenced by maybe_add_partial_symtab_filename(), and output_source_filename().

struct symtab_and_line find_function_start_sal ( struct symbol sym,
int  funfirstline 
)
static int find_line_common ( struct linetable l,
int  lineno,
int exact_match,
int  start 
)
static

Definition at line 3551 of file symtab.c.

References linetable::item, len, linetable_entry::line, and linetable::nitems.

Referenced by find_line_symtab(), and VEC().

int find_line_pc ( struct symtab symtab,
int  line,
CORE_ADDR pc 
)
int find_line_pc_range ( struct symtab_and_line  sal,
CORE_ADDR startptr,
CORE_ADDR endptr 
)
struct symtab* find_line_symtab ( struct symtab symtab,
int  line,
int index,
int exact_match 
)
static void find_main_name ( void  )
static
struct compunit_symtab* find_pc_compunit_symtab ( CORE_ADDR  pc)
struct symtab_and_line find_pc_line ( CORE_ADDR  pc,
int  notcurrent 
)

Definition at line 3315 of file symtab.c.

References find_pc_overlay(), find_pc_sect_line(), overlay_mapped_address(), symtab_and_line::pc, pc_in_unmapped_range(), and symtab_and_line::section.

Referenced by aarch64_scan_prologue(), after_prologue(), alpha_after_prologue(), arm_linux_copy_svc(), btrace_compute_src_line_range(), c_parse(), call0_analyze_prologue(), convert_linespec_to_sals(), cris_skip_prologue(), decode_static_tracepoint_spec(), default_macro_scope(), do_mixed_source_and_assembly(), elf_gnu_ifunc_resolver_return_stop(), find_frame_sal(), find_last_line_symbol(), find_pc_line_pc_range(), find_pc_line_symtab(), find_pc_sect_line(), finish_backward(), finish_forward(), frv_skip_prologue(), ft32_skip_prologue(), gdbpy_find_pc_line(), gdbscm_find_pc_line(), h8300_skip_prologue(), handle_step_into_function(), handle_step_into_function_backward(), info_checkpoints_command(), insert_single_step_breakpoint(), iq2000_skip_prologue(), m32r_skip_prologue(), m68hc11_skip_prologue(), m88k_skip_prologue(), microblaze_skip_prologue(), moxie_skip_prologue(), mt_skip_prologue(), parse_breakpoint_sals(), print_one_static_tracepoint_marker(), process_event_stop_test(), refine_prologue_limit(), save_bookmark_command(), set_momentary_breakpoint_at_pc(), set_traceframe_context(), skip_prologue(), skip_prologue_using_sal(), sparc32_skip_prologue(), sparc64_skip_prologue(), trace_find_line_command(), tui_show_disassem_and_update_source(), tui_update_source_windows_with_addr(), until_break_command(), until_next_command(), update_static_tracepoint(), v850_skip_prologue(), write_macro_definitions(), xstormy16_skip_prologue(), and xtensa_skip_prologue().

int find_pc_line_pc_range ( CORE_ADDR  pc,
CORE_ADDR startptr,
CORE_ADDR endptr 
)

Definition at line 3595 of file symtab.c.

References find_pc_line().

Referenced by step_once().

struct symtab* find_pc_line_symtab ( CORE_ADDR  pc)
struct compunit_symtab* find_pc_sect_compunit_symtab ( CORE_ADDR  pc,
struct obj_section section 
)
struct symtab_and_line find_pc_sect_line ( CORE_ADDR  pc,
struct obj_section section,
int  notcurrent 
)
void fixup_section ( struct general_symbol_info ginfo,
CORE_ADDR  addr,
struct objfile objfile 
)
struct symbol* fixup_symbol_section ( struct symbol sym,
struct objfile objfile 
)
static void free_completion_list ( VEC(char_ptr)**  list_ptr)
static

Definition at line 5011 of file symtab.c.

References VEC_free, VEC_iterate, and xfree().

Referenced by do_free_completion_list().

void free_search_symbols ( struct symbol_search symbols)

Definition at line 4306 of file symtab.c.

References symbol_search::next, and xfree().

Referenced by do_free_search_symbols_cleanup().

static void free_symbol_cache ( struct symbol_cache cache)
static

Definition at line 1319 of file symtab.c.

References symbol_cache::global_symbols, symbol_cache::static_symbols, and xfree().

Referenced by symbol_cache_cleanup().

static void functions_info ( char *  regexp,
int  from_tty 
)
static

Definition at line 4857 of file symtab.c.

References FUNCTIONS_DOMAIN, and symtab_symbol_info().

Referenced by _initialize_symtab().

char* gdb_mangle_name ( struct type type,
int  method_id,
int  signature_id 
)
gdb_static_assert ( MAX_SYMBOL_IMPLS<=  1<< SYMBOL_ACLASS_BITS)
static struct main_info* get_main_info ( void  )
static
static struct symbol_cache* get_symbol_cache ( struct program_space pspace)
static

Definition at line 1330 of file symtab.c.

References make_symbol_cache(), symbol_cache_key, and symbol_cache_size.

Referenced by lookup_global_symbol(), and lookup_static_symbol().

static hashval_t hash_demangled_name_entry ( const void *  data)
static

Definition at line 667 of file symtab.c.

References demangled_name_entry::mangled.

Referenced by create_demangled_names_hash().

static unsigned int hash_symbol_entry ( const struct objfile objfile_context,
const char *  name,
domain_enum  domain 
)
static

Definition at line 1170 of file symtab.c.

References hash(), STRUCT_DOMAIN, and VAR_DOMAIN.

Referenced by symbol_cache_lookup().

void init_sal ( struct symtab_and_line sal)
void initialize_objfile_symbol ( struct symbol sym)

Definition at line 6194 of file symtab.c.

References initialize_objfile_symbol_1().

Referenced by process_xcoff_symbol().

static void initialize_objfile_symbol_1 ( struct symbol sym)
static
static void initialize_ordinary_address_classes ( void  )
static

Definition at line 6171 of file symtab.c.

References symbol_impl::aclass, and LOC_FINAL_VALUE.

Referenced by _initialize_symtab().

int iterate_over_some_symtabs ( const char *  name,
const char *  real_path,
int(*)(struct symtab *symtab, void *data)  callback,
void *  data,
struct compunit_symtab first,
struct compunit_symtab after_last 
)
void iterate_over_symbols ( const struct block block,
const char *  name,
const domain_enum  domain,
symbol_found_callback_ftype callback,
void *  data 
)
void iterate_over_symtabs ( const char *  name,
int(*)(struct symtab *symtab, void *data)  callback,
void *  data 
)
static const char* language_search_unquoted_string ( const char *  text,
const char *  p 
)
static

Definition at line 5174 of file symtab.c.

References current_language, language_defn::la_language, and language_objc.

struct symbol* lookup_global_symbol ( const char *  name,
const struct block block,
const domain_enum  domain 
)
struct symbol* lookup_global_symbol_from_objfile ( struct objfile main_objfile,
const char *  name,
const domain_enum  domain 
)
struct symbol* lookup_language_this ( const struct language_defn lang,
const struct block block 
)
static struct symbol* lookup_local_symbol ( const char *  name,
const struct block block,
const domain_enum  domain,
enum language  language 
)
static

Referenced by lookup_symbol_aux().

static struct symbol* lookup_local_symbol ( const char *  name,
const struct block block,
const domain_enum  domain,
enum language  language 
)
static
struct objfile* lookup_objfile_from_block ( const struct block block)
struct symbol* lookup_static_symbol ( const char *  name,
const domain_enum  domain 
)
struct symbol* lookup_symbol ( const char *  name,
const struct block block,
domain_enum  domain,
struct field_of_this_result is_a_field_of_this 
)
static struct symbol* lookup_symbol_aux ( const char *  name,
const struct block block,
const domain_enum  domain,
enum language  language,
struct field_of_this_result  
)
static
static struct symbol* lookup_symbol_aux ( const char *  name,
const struct block block,
const domain_enum  domain,
enum language  language,
struct field_of_this_result is_a_field_of_this 
)
static
static int lookup_symbol_global_iterator_cb ( struct objfile objfile,
void *  cb_data 
)
static
struct symbol* lookup_symbol_in_block ( const char *  name,
const struct block block,
const domain_enum  domain 
)
struct symbol* lookup_symbol_in_language ( const char *  name,
const struct block block,
const domain_enum  domain,
enum language  lang,
struct field_of_this_result is_a_field_of_this 
)
static struct symbol * lookup_symbol_in_objfile ( struct objfile objfile,
int  block_index,
const char *  name,
const domain_enum  domain 
)
static
static struct symbol* lookup_symbol_in_objfile_from_linkage_name ( struct objfile objfile,
const char *  linkage_name,
domain_enum  domain 
)
static
static struct symbol* lookup_symbol_in_objfile_symtabs ( struct objfile objfile,
int  block_index,
const char *  name,
const domain_enum  domain 
)
static
struct symbol* lookup_symbol_in_static_block ( const char *  name,
const struct block block,
const domain_enum  domain 
)
static struct symbol* lookup_symbol_via_quick_fns ( struct objfile objfile,
int  block_index,
const char *  name,
const domain_enum  domain 
)
static
struct symtab* lookup_symtab ( const char *  name)
static int lookup_symtab_callback ( struct symtab symtab,
void *  data 
)
static

Definition at line 477 of file symtab.c.

Referenced by lookup_symtab().

struct type* lookup_transparent_type ( const char *  name)

Definition at line 2781 of file symtab.c.

References current_language, and language_defn::la_lookup_transparent_type.

Referenced by check_typedef().

static void main_info_cleanup ( struct program_space pspace,
void *  data 
)
static

Definition at line 5913 of file symtab.c.

References main_info::name_of_main, and xfree().

Referenced by _initialize_symtab().

enum language main_language ( void  )
char* main_name ( void  )
static void maintenance_flush_symbol_cache ( char *  args,
int  from_tty 
)
static

Definition at line 1639 of file symtab.c.

References ALL_PSPACES, and symbol_cache_flush().

Referenced by _initialize_symtab().

static void maintenance_print_symbol_cache ( char *  args,
int  from_tty 
)
static
static void maintenance_print_symbol_cache_statistics ( char *  args,
int  from_tty 
)
static
struct cleanup* make_cleanup_free_search_symbols ( struct symbol_search **  symbolsp)

Definition at line 4327 of file symtab.c.

References do_free_search_symbols_cleanup(), and make_cleanup().

Referenced by rbreak_command(), search_symbols(), and symtab_symbol_info().

static struct symbol_cache* make_symbol_cache ( unsigned int  size)
static

Definition at line 1307 of file symtab.c.

References resize_symbol_cache(), and symbol_cache_size.

Referenced by get_symbol_cache().

int matching_obj_sections ( struct obj_section obj_first,
struct obj_section obj_second 
)
static void maybe_add_partial_symtab_filename ( const char *  filename,
const char *  fullname,
void *  user_data 
)
static
const char* multiple_symbols_select_mode ( void  )

Definition at line 241 of file symtab.c.

References multiple_symbols_mode.

Referenced by decode_line_full(), and user_select_syms().

static int not_interesting_fname ( const char *  fname)
static

Definition at line 5759 of file symtab.c.

Referenced by maybe_add_partial_symtab_filename().

static const char* operator_chars ( const char *  p,
const char **  end 
)
static

Definition at line 3984 of file symtab.c.

References _, symtab_and_line::end, error(), and startswith().

Referenced by search_symbols().

static void output_partial_symbol_filename ( const char *  filename,
const char *  fullname,
void *  data 
)
static

Definition at line 4233 of file symtab.c.

References output_source_filename().

Referenced by sources_info().

static void output_source_filename ( const char *  name,
struct output_source_filename_data data 
)
static
static void print_msymbol_info ( struct bound_minimal_symbol  msymbol)
static
static void print_symbol_info ( enum search_domain  kind,
struct symbol sym,
int  block,
const char *  last 
)
static
int producer_is_realview ( const char *  producer)

Definition at line 6052 of file symtab.c.

References startswith().

Referenced by dwarf2_frame_find_quirks(), prototyped_function_p(), and read_structure_type().

static void rbreak_command ( char *  regexp,
int  from_tty 
)
static
void rbreak_command_wrapper ( char *  regexp,
int  from_tty 
)

Definition at line 4872 of file symtab.c.

References rbreak_command().

int register_symbol_block_impl ( enum address_class  aclass,
const struct symbol_block_ops ops 
)
int register_symbol_computed_impl ( enum address_class  aclass,
const struct symbol_computed_ops ops 
)
int register_symbol_register_impl ( enum address_class  aclass,
const struct symbol_register_ops ops 
)
static void resize_symbol_cache ( struct symbol_cache cache,
unsigned int  new_size 
)
static
const char* search_domain_name ( enum search_domain  e)
void search_symbols ( const char *  regexp,
enum search_domain  kind,
int  nfiles,
const char *  files[],
struct symbol_search **  matches 
)
static int search_symbols_file_matches ( const char *  filename,
void *  user_data,
int  basenames 
)
static

Definition at line 4420 of file symtab.c.

References file_matches(), search_symbols_data::files, and search_symbols_data::nfiles.

Referenced by search_symbols().

static int search_symbols_name_matches ( const char *  symname,
void *  user_data 
)
static

Definition at line 4431 of file symtab.c.

References search_symbols_data::preg, and search_symbols_data::preg_p.

Referenced by search_symbols().

static void set_main_name ( const char *  name,
enum language  lang 
)
static
static void set_symbol_cache_size ( unsigned int  new_size)
static

Definition at line 1357 of file symtab.c.

References ALL_PSPACES, resize_symbol_cache(), and symbol_cache_key.

Referenced by set_symbol_cache_size_handler().

static void set_symbol_cache_size_handler ( char *  args,
int  from_tty,
struct cmd_list_element c 
)
static
void skip_prologue_sal ( struct symtab_and_line sal)
static CORE_ADDR skip_prologue_using_lineinfo ( CORE_ADDR  func_addr,
struct symtab symtab 
)
static
CORE_ADDR skip_prologue_using_sal ( struct gdbarch gdbarch,
CORE_ADDR  func_addr 
)
static void sort_search_symbols_remove_dups ( struct symbol_search found,
int  nfound,
struct symbol_search **  new_head,
struct symbol_search **  new_tail 
)
static
static void sources_info ( char *  ignore,
int  from_tty 
)
static
struct gdbarch* symbol_arch ( const struct symbol symbol)
static size_t symbol_cache_byte_size ( unsigned int  size)
static

Definition at line 1265 of file symtab.c.

Referenced by resize_symbol_cache().

static void symbol_cache_cleanup ( struct program_space pspace,
void *  data 
)
static

Definition at line 1347 of file symtab.c.

References free_symbol_cache().

Referenced by _initialize_symtab().

static void symbol_cache_clear_slot ( struct symbol_cache_slot slot)
static
static void symbol_cache_dump ( const struct symbol_cache cache)
static
static void symbol_cache_flush ( struct program_space pspace)
static
static struct symbol* symbol_cache_lookup ( struct symbol_cache cache,
struct objfile objfile_context,
int  block,
const char *  name,
domain_enum  domain,
struct block_symbol_cache **  bsc_ptr,
struct symbol_cache_slot **  slot_ptr 
)
static
static void symbol_cache_mark_found ( struct block_symbol_cache bsc,
struct symbol_cache_slot slot,
struct objfile objfile_context,
struct symbol symbol 
)
static
static void symbol_cache_mark_not_found ( struct block_symbol_cache bsc,
struct symbol_cache_slot slot,
struct objfile objfile_context,
const char *  name,
domain_enum  domain 
)
static
static void symbol_cache_stats ( struct symbol_cache cache)
static
static int symbol_completion_matcher ( const char *  name,
void *  user_data 
)
static
const char* symbol_demangled_name ( const struct general_symbol_info gsymbol)
static char* symbol_find_demangled_name ( struct general_symbol_info gsymbol,
const char *  mangled 
)
static
const char* symbol_get_demangled_name ( const struct general_symbol_info gsymbol)
int symbol_matches_domain ( enum language  symbol_language,
domain_enum  symbol_domain,
domain_enum  domain 
)
const char* symbol_natural_name ( const struct general_symbol_info gsymbol)
struct objfile* symbol_objfile ( const struct symbol symbol)
const char* symbol_search_name ( const struct general_symbol_info gsymbol)
void symbol_set_demangled_name ( struct general_symbol_info gsymbol,
const char *  name,
struct obstack *  obstack 
)
void symbol_set_language ( struct general_symbol_info gsymbol,
enum language language  ,
struct obstack *  obstack 
)
void symbol_set_names ( struct general_symbol_info gsymbol,
const char *  linkage_name,
int  len,
int  copy_name,
struct objfile objfile 
)
void symbol_set_symtab ( struct symbol symbol,
struct symtab symtab 
)
struct symtab* symbol_symtab ( const struct symbol symbol)
static void symtab_expansion_callback ( struct compunit_symtab symtab,
void *  user_data 
)
static
static void symtab_free_objfile_observer ( struct objfile objfile)
static

Definition at line 1719 of file symtab.c.

References objfile::pspace, and symbol_cache_flush().

Referenced by _initialize_symtab().

static void symtab_new_objfile_observer ( struct objfile objfile)
static

Definition at line 1710 of file symtab.c.

References current_program_space, and symbol_cache_flush().

Referenced by _initialize_symtab().

static void symtab_observer_executable_changed ( void  )
static

Definition at line 6042 of file symtab.c.

References language_unknown, and set_main_name().

Referenced by _initialize_symtab().

static void symtab_symbol_info ( char *  regexp,
enum search_domain  kind,
int  from_tty 
)
static
static void types_info ( char *  regexp,
int  from_tty 
)
static

Definition at line 4864 of file symtab.c.

References symtab_symbol_info(), and TYPES_DOMAIN.

Referenced by _initialize_symtab().

static void variables_info ( char *  regexp,
int  from_tty 
)
static

Definition at line 4851 of file symtab.c.

References symtab_symbol_info(), and VARIABLES_DOMAIN.

Referenced by _initialize_symtab().

VEC ( CORE_ADDR  )
static VEC ( char_ptr  )
static

Variable Documentation

initialize_file_ftype _initialize_symtab
int basenames_may_differ = 0
const struct block* block_found
const struct program_space_data* main_progspace_key
static

Definition at line 91 of file symtab.c.

Referenced by _initialize_symtab(), and get_main_info().

const char multiple_symbols_all[] = "all"
const char multiple_symbols_ask[] = "ask"

Definition at line 226 of file symtab.c.

Referenced by decode_line_full().

const char multiple_symbols_cancel[] = "cancel"

Definition at line 228 of file symtab.c.

Referenced by decode_line_2(), decode_line_full(), and user_select_syms().

const char* multiple_symbols_mode = multiple_symbols_all
static

Definition at line 236 of file symtab.c.

Referenced by _initialize_symtab(), and multiple_symbols_select_mode().

const char* const multiple_symbols_modes[]
static
Initial value:
=
{
NULL
}
const char multiple_symbols_cancel[]
Definition: symtab.c:228
const char multiple_symbols_ask[]
Definition: symtab.c:226
const char multiple_symbols_all[]
Definition: symtab.c:227

Definition at line 229 of file symtab.c.

Referenced by _initialize_symtab().

unsigned int new_symbol_cache_size = DEFAULT_SYMBOL_CACHE_SIZE
static

Definition at line 210 of file symtab.c.

Referenced by _initialize_symtab(), and set_symbol_cache_size_handler().

int next_aclass_value = LOC_FINAL_VALUE
static

Definition at line 6078 of file symtab.c.

const struct program_space_data* symbol_cache_key
static
unsigned int symbol_cache_size = DEFAULT_SYMBOL_CACHE_SIZE
static

Definition at line 6088 of file symtab.c.

const struct symbol_impl* symbol_impls = &symbol_impl[0]

Definition at line 6093 of file symtab.c.

unsigned int symbol_lookup_debug = 0
unsigned int symtab_create_debug = 0