GDB (xrefs)
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/psymtab.c File Reference
#include "defs.h"
#include "symtab.h"
#include "psympriv.h"
#include "objfiles.h"
#include "gdb_assert.h"
#include "block.h"
#include "filenames.h"
#include "source.h"
#include "addrmap.h"
#include "gdbtypes.h"
#include "bcache.h"
#include "ui-out.h"
#include "command.h"
#include "readline/readline.h"
#include "gdb_regex.h"
#include "dictionary.h"
#include "language.h"
#include "cp-support.h"
#include "gdbcmd.h"

Go to the source code of this file.

Classes

struct  psymbol_bcache
struct  psymtab_state

Defines

#define DEV_TTY   "/dev/tty"
#define ALL_OBJFILE_PSYMTABS_REQUIRED(objfile, p)
#define ALL_PSYMTABS(objfile, p)

Functions

static struct partial_symbolmatch_partial_symbol (struct objfile *, struct partial_symtab *, int, const char *, domain_enum, symbol_compare_ftype *, symbol_compare_ftype *)
static struct partial_symbollookup_partial_symbol (struct objfile *, struct partial_symtab *, const char *, int, domain_enum)
static const char * psymtab_to_fullname (struct partial_symtab *ps)
static struct partial_symbolfind_pc_sect_psymbol (struct objfile *, struct partial_symtab *, CORE_ADDR, struct obj_section *)
static void fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
static struct symtabpsymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst)
struct objfilerequire_partial_symbols (struct objfile *objfile, int verbose)
static int partial_map_expand_apply (struct objfile *objfile, const char *name, const char *real_path, struct partial_symtab *pst, int(*callback)(struct symtab *, void *), void *data)
static int partial_map_symtabs_matching_filename (struct objfile *objfile, const char *name, const char *real_path, int(*callback)(struct symtab *, void *), void *data)
static struct partial_symtabfind_pc_sect_psymtab_closer (struct objfile *objfile, CORE_ADDR pc, struct obj_section *section, struct partial_symtab *pst, struct minimal_symbol *msymbol)
static struct partial_symtabfind_pc_sect_psymtab (struct objfile *objfile, CORE_ADDR pc, struct obj_section *section, struct minimal_symbol *msymbol)
static struct symtabfind_pc_sect_symtab_from_partial (struct objfile *objfile, struct minimal_symbol *msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin)
static struct symtablookup_symbol_aux_psymtabs (struct objfile *objfile, int block_index, const char *name, const domain_enum domain)
static char * psymtab_search_name (const char *name)
static void relocate_psymtabs (struct objfile *objfile, const struct section_offsets *new_offsets, const struct section_offsets *delta)
static struct symtabfind_last_source_symtab_from_partial (struct objfile *ofp)
static void forget_cached_source_info_partial (struct objfile *objfile)
static void print_partial_symbols (struct gdbarch *gdbarch, struct partial_symbol **p, int count, char *what, struct ui_file *outfile)
static void dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab, struct ui_file *outfile)
static void print_psymtab_stats_for_objfile (struct objfile *objfile)
static void dump_psymtabs_for_objfile (struct objfile *objfile)
static void read_symtabs_for_function (struct objfile *objfile, const char *func_name)
static void expand_partial_symbol_tables (struct objfile *objfile)
static void read_psymtabs_with_fullname (struct objfile *objfile, const char *fullname)
static void map_symbol_filenames_psymtab (struct objfile *objfile, symbol_filename_ftype *fun, void *data, int need_fullname)
static int map_block (const char *name, domain_enum namespace, struct objfile *objfile, struct block *block, int(*callback)(struct block *, struct symbol *, void *), void *data, symbol_compare_ftype *match)
static void map_matching_symbols_psymtab (struct objfile *objfile, const char *name, domain_enum namespace, int global, int(*callback)(struct block *, struct symbol *, void *), void *data, symbol_compare_ftype *match, symbol_compare_ftype *ordered_compare)
static int recursively_search_psymtabs (struct partial_symtab *ps, struct objfile *objfile, enum search_domain kind, int(*name_matcher)(const char *, void *), void *data)
static void expand_symtabs_matching_via_partial (struct objfile *objfile, int(*file_matcher)(const char *, void *, int basenames), int(*name_matcher)(const char *, void *), enum search_domain kind, void *data)
static int objfile_has_psyms (struct objfile *objfile)
static int compare_psymbols (const void *s1p, const void *s2p)
void sort_pst_symbols (struct objfile *objfile, struct partial_symtab *pst)
struct partial_symtabstart_psymtab_common (struct objfile *objfile, struct section_offsets *section_offsets, const char *filename, CORE_ADDR textlow, struct partial_symbol **global_syms, struct partial_symbol **static_syms)
static unsigned long psymbol_hash (const void *addr, int length)
static int psymbol_compare (const void *addr1, const void *addr2, int length)
struct psymbol_bcachepsymbol_bcache_init (void)
void psymbol_bcache_free (struct psymbol_bcache *bcache)
struct bcachepsymbol_bcache_get_bcache (struct psymbol_bcache *bcache)
static struct partial_symbolpsymbol_bcache_full (struct partial_symbol *sym, struct psymbol_bcache *bcache, int *added)
static struct partial_symboladd_psymbol_to_bcache (const char *name, int namelength, int copy_name, domain_enum domain, enum address_class class, long val, CORE_ADDR coreaddr, enum language language, struct objfile *objfile, int *added)
static void extend_psymbol_list (struct psymbol_allocation_list *listp, struct objfile *objfile)
static void append_psymbol_to_list (struct psymbol_allocation_list *list, const struct partial_symbol *psym, struct objfile *objfile)
void add_psymbol_to_list (const char *name, int namelength, int copy_name, domain_enum domain, enum address_class class, struct psymbol_allocation_list *list, long val, CORE_ADDR coreaddr, enum language language, struct objfile *objfile)
void init_psymbol_list (struct objfile *objfile, int total_symbols)
struct partial_symtaballocate_psymtab (const char *filename, struct objfile *objfile)
void discard_psymtab (struct objfile *objfile, struct partial_symtab *pst)
static void discard_psymtabs_upto (void *arg)
struct cleanupmake_cleanup_discard_psymtabs (struct objfile *objfile)
static void maintenance_print_psymbols (char *args, int from_tty)
static void maintenance_info_psymtabs (char *regexp, int from_tty)
static void maintenance_check_psymtabs (char *ignore, int from_tty)
void expand_partial_symbol_names (int(*fun)(const char *, void *), void *data)
void map_partial_symbol_filenames (symbol_filename_ftype *fun, void *data, int need_fullname)
void _initialize_psymtab (void)

Variables

struct quick_symbol_functions psym_functions
initialize_file_ftype _initialize_psymtab

Define Documentation

#define ALL_OBJFILE_PSYMTABS_REQUIRED (   objfile,
  p 
)
#define ALL_PSYMTABS (   objfile,
  p 
)
Value:
ALL_OBJFILES (objfile)   \
    ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, p)

Definition at line 124 of file psymtab.c.

Referenced by maintenance_check_psymtabs(), and maintenance_print_psymbols().

#define DEV_TTY   "/dev/tty"

Definition at line 41 of file psymtab.c.

Referenced by maintenance_print_psymbols().


Function Documentation

void _initialize_psymtab ( void  )
static struct partial_symbol* add_psymbol_to_bcache ( const char *  name,
int  namelength,
int  copy_name,
domain_enum  domain,
enum address_class  class,
long  val,
CORE_ADDR  coreaddr,
enum language  language,
struct objfile objfile,
int added 
) [static, read]
void add_psymbol_to_list ( const char *  name,
int  namelength,
int  copy_name,
domain_enum  domain,
enum address_class  class,
struct psymbol_allocation_list list,
long  val,
CORE_ADDR  coreaddr,
enum language language  ,
struct objfile objfile 
)
struct partial_symtab* allocate_psymtab ( const char *  filename,
struct objfile objfile 
) [read]
static void append_psymbol_to_list ( struct psymbol_allocation_list list,
const struct partial_symbol psym,
struct objfile objfile 
) [static]
static int compare_psymbols ( const void *  s1p,
const void *  s2p 
) [static]

Definition at line 1445 of file psymtab.c.

References strcmp_iw_ordered(), and SYMBOL_SEARCH_NAME.

Referenced by sort_pst_symbols().

void discard_psymtab ( struct objfile objfile,
struct partial_symtab pst 
)
static void discard_psymtabs_upto ( void *  arg) [static]
static void dump_psymtab ( struct objfile objfile,
struct partial_symtab psymtab,
struct ui_file outfile 
) [static]
static void dump_psymtabs_for_objfile ( struct objfile objfile) [static]
void expand_partial_symbol_names ( int(*)(const char *, void *)  fun,
void *  data 
)
static void expand_partial_symbol_tables ( struct objfile objfile) [static]

Definition at line 1101 of file psymtab.c.

References ALL_OBJFILE_PSYMTABS_REQUIRED, and psymtab_to_symtab().

static void expand_symtabs_matching_via_partial ( struct objfile objfile,
int(*)(const char *, void *, int basenames)  file_matcher,
int(*)(const char *, void *)  name_matcher,
enum search_domain  kind,
void *  data 
) [static]
static void extend_psymbol_list ( struct psymbol_allocation_list listp,
struct objfile objfile 
) [static]
static struct symtab* find_last_source_symtab_from_partial ( struct objfile ofp) [static, read]
static struct partial_symbol * find_pc_sect_psymbol ( struct objfile objfile,
struct partial_symtab psymtab,
CORE_ADDR  pc,
struct obj_section section 
) [static, read]
static struct partial_symtab* find_pc_sect_psymtab ( struct objfile objfile,
CORE_ADDR  pc,
struct obj_section section,
struct minimal_symbol msymbol 
) [static, read]
static struct partial_symtab* find_pc_sect_psymtab_closer ( struct objfile objfile,
CORE_ADDR  pc,
struct obj_section section,
struct partial_symtab pst,
struct minimal_symbol msymbol 
) [static, read]
static struct symtab* find_pc_sect_symtab_from_partial ( struct objfile objfile,
struct minimal_symbol msymbol,
CORE_ADDR  pc,
struct obj_section section,
int  warn_if_readin 
) [static, read]
static void fixup_psymbol_section ( struct partial_symbol psym,
struct objfile objfile 
) [static]
static void forget_cached_source_info_partial ( struct objfile objfile) [static]

Definition at line 851 of file psymtab.c.

References ALL_OBJFILE_PSYMTABS_REQUIRED, partial_symtab::fullname, and xfree().

void init_psymbol_list ( struct objfile objfile,
int  total_symbols 
)
static struct partial_symbol * lookup_partial_symbol ( struct objfile objfile,
struct partial_symtab pst,
const char *  name,
int  global,
domain_enum  domain 
) [static, read]
static struct symtab* lookup_symbol_aux_psymtabs ( struct objfile objfile,
int  block_index,
const char *  name,
const domain_enum  domain 
) [static, read]
static void maintenance_check_psymtabs ( char *  ignore,
int  from_tty 
) [static]
static void maintenance_info_psymtabs ( char *  regexp,
int  from_tty 
) [static]
static void maintenance_print_psymbols ( char *  args,
int  from_tty 
) [static]
struct cleanup* make_cleanup_discard_psymtabs ( struct objfile objfile) [read]
static int map_block ( const char *  name,
domain_enum  namespace,
struct objfile objfile,
struct block block,
int(*)(struct block *, struct symbol *, void *)  callback,
void *  data,
symbol_compare_ftype match 
) [static]
static void map_matching_symbols_psymtab ( struct objfile objfile,
const char *  name,
domain_enum  namespace,
int  global,
int(*)(struct block *, struct symbol *, void *)  callback,
void *  data,
symbol_compare_ftype match,
symbol_compare_ftype ordered_compare 
) [static]
void map_partial_symbol_filenames ( symbol_filename_ftype fun,
void *  data,
int  need_fullname 
)
static void map_symbol_filenames_psymtab ( struct objfile objfile,
symbol_filename_ftype fun,
void *  data,
int  need_fullname 
) [static]
static struct partial_symbol * match_partial_symbol ( struct objfile objfile,
struct partial_symtab pst,
int  global,
const char *  name,
domain_enum  domain,
symbol_compare_ftype match,
symbol_compare_ftype ordered_compare 
) [static, read]
static int objfile_has_psyms ( struct objfile objfile) [static]

Definition at line 1415 of file psymtab.c.

References objfile::psymtabs.

static int partial_map_expand_apply ( struct objfile objfile,
const char *  name,
const char *  real_path,
struct partial_symtab pst,
int(*)(struct symtab *, void *)  callback,
void *  data 
) [static]
static int partial_map_symtabs_matching_filename ( struct objfile objfile,
const char *  name,
const char *  real_path,
int(*)(struct symtab *, void *)  callback,
void *  data 
) [static]
static void print_partial_symbols ( struct gdbarch gdbarch,
struct partial_symbol **  p,
int  count,
char *  what,
struct ui_file outfile 
) [static]
static void print_psymtab_stats_for_objfile ( struct objfile objfile) [static]
void psymbol_bcache_free ( struct psymbol_bcache bcache)

Definition at line 1540 of file psymtab.c.

References psymbol_bcache::bcache, bcache_xfree(), and xfree().

Referenced by free_objfile(), and reread_symbols().

static struct partial_symbol* psymbol_bcache_full ( struct partial_symbol sym,
struct psymbol_bcache bcache,
int added 
) [static, read]

Definition at line 1563 of file psymtab.c.

References psymbol_bcache::bcache, and bcache_full().

Referenced by add_psymbol_to_bcache().

struct bcache* psymbol_bcache_get_bcache ( struct psymbol_bcache bcache) [read]

Definition at line 1552 of file psymtab.c.

References psymbol_bcache::bcache.

Referenced by print_objfile_statistics(), and print_symbol_bcache_statistics().

struct psymbol_bcache* psymbol_bcache_init ( void  ) [read]
static int psymbol_compare ( const void *  addr1,
const void *  addr2,
int  length 
) [static]
static unsigned long psymbol_hash ( const void *  addr,
int  length 
) [static]

Definition at line 1493 of file psymtab.c.

References partial_symbol::ginfo, hash_continue(), PSYMBOL_CLASS, and PSYMBOL_DOMAIN.

Referenced by psymbol_bcache_init().

static char* psymtab_search_name ( const char *  name) [static]
static const char * psymtab_to_fullname ( struct partial_symtab ps) [static]
static struct symtab * psymtab_to_symtab ( struct objfile objfile,
struct partial_symtab pst 
) [static, read]
static void read_psymtabs_with_fullname ( struct objfile objfile,
const char *  fullname 
) [static]
static void read_symtabs_for_function ( struct objfile objfile,
const char *  func_name 
) [static]
static int recursively_search_psymtabs ( struct partial_symtab ps,
struct objfile objfile,
enum search_domain  kind,
int(*)(const char *, void *)  name_matcher,
void *  data 
) [static]
static void relocate_psymtabs ( struct objfile objfile,
const struct section_offsets new_offsets,
const struct section_offsets delta 
) [static]
struct objfile* require_partial_symbols ( struct objfile objfile,
int  verbose 
) [read]
void sort_pst_symbols ( struct objfile objfile,
struct partial_symtab pst 
)
struct partial_symtab* start_psymtab_common ( struct objfile objfile,
struct section_offsets section_offsets,
const char *  filename,
CORE_ADDR  textlow,
struct partial_symbol **  global_syms,
struct partial_symbol **  static_syms 
) [read]

Variable Documentation

Referenced by initialize_all_files().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines