GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-7.10/gdb/psymtab.c File Reference
#include "defs.h"
#include "symtab.h"
#include "psympriv.h"
#include "objfiles.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
 

Macros

#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 compunit_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 psym_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 bound_minimal_symbol msymbol)
 
static struct partial_symtabfind_pc_sect_psymtab (struct objfile *objfile, CORE_ADDR pc, struct obj_section *section, struct bound_minimal_symbol msymbol)
 
static struct compunit_symtabpsym_find_pc_sect_compunit_symtab (struct objfile *objfile, struct bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin)
 
static struct compunit_symtabpsym_lookup_symbol (struct objfile *objfile, int block_index, const char *name, const domain_enum domain)
 
static char * psymtab_search_name (const char *name)
 
static void psym_relocate (struct objfile *objfile, const struct section_offsets *new_offsets, const struct section_offsets *delta)
 
static struct symtabpsym_find_last_source_symtab (struct objfile *ofp)
 
static void psym_forget_cached_source_info (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 psym_print_stats (struct objfile *objfile)
 
static void psym_dump (struct objfile *objfile)
 
static void psym_expand_symtabs_for_function (struct objfile *objfile, const char *func_name)
 
static void psym_expand_all_symtabs (struct objfile *objfile)
 
static void psym_expand_symtabs_with_fullname (struct objfile *objfile, const char *fullname)
 
static void psym_map_symbol_filenames (struct objfile *objfile, symbol_filename_ftype *fun, void *data, int need_fullname)
 
static int map_block (const char *name, domain_enum domain, struct objfile *objfile, struct block *block, int(*callback)(struct block *, struct symbol *, void *), void *data, symbol_compare_ftype *match)
 
static void psym_map_matching_symbols (struct objfile *objfile, const char *name, domain_enum domain, 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, expand_symtabs_symbol_matcher_ftype *sym_matcher, void *data)
 
static void psym_expand_symtabs_matching (struct objfile *objfile, expand_symtabs_file_matcher_ftype *file_matcher, expand_symtabs_symbol_matcher_ftype *symbol_matcher, expand_symtabs_exp_notify_ftype *expansion_notify, enum search_domain kind, void *data)
 
static int psym_has_symbols (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, 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 const struct partial_symbolpsymbol_bcache_full (struct partial_symbol *sym, struct psymbol_bcache *bcache, int *added)
 
static const struct partial_symboladd_psymbol_to_bcache (const char *name, int namelength, int copy_name, domain_enum domain, enum address_class theclass, 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 theclass, 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 _initialize_psymtab (void)
 

Variables

const struct quick_symbol_functions psym_functions
 
initialize_file_ftype _initialize_psymtab
 

Macro Definition Documentation

#define ALL_OBJFILE_PSYMTABS_REQUIRED (   objfile,
 
)
#define ALL_PSYMTABS (   objfile,
 
)
Value:
ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, p)
#define ALL_OBJFILES(obj)
Definition: objfiles.h:579

Definition at line 123 of file psymtab.c.

Referenced by maintenance_check_psymtabs(), and maintenance_print_psymbols().

#define DEV_TTY   "/dev/tty"

Definition at line 40 of file psymtab.c.

Referenced by maintenance_print_psymbols().

Function Documentation

void _initialize_psymtab ( void  )
static const struct partial_symbol* add_psymbol_to_bcache ( const char *  name,
int  namelength,
int  copy_name,
domain_enum  domain,
enum address_class  theclass,
long  val,
CORE_ADDR  coreaddr,
enum language  language,
struct objfile objfile,
int added 
)
static
void add_psymbol_to_list ( const char *  name,
int  namelength,
int  copy_name,
domain_enum  domain,
enum address_class  theclass,
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 
)
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 1491 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 extend_psymbol_list ( struct psymbol_allocation_list listp,
struct objfile objfile 
)
static
static struct partial_symbol * find_pc_sect_psymbol ( struct objfile objfile,
struct partial_symtab psymtab,
CORE_ADDR  pc,
struct obj_section section 
)
static
static struct partial_symtab* find_pc_sect_psymtab ( struct objfile objfile,
CORE_ADDR  pc,
struct obj_section section,
struct bound_minimal_symbol  msymbol 
)
static
static struct partial_symtab* find_pc_sect_psymtab_closer ( struct objfile objfile,
CORE_ADDR  pc,
struct obj_section section,
struct partial_symtab pst,
struct bound_minimal_symbol  msymbol 
)
static
static void fixup_psymbol_section ( struct partial_symbol psym,
struct objfile objfile 
)
static
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
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)
static int map_block ( const char *  name,
domain_enum  domain,
struct objfile objfile,
struct block block,
int(*)(struct block *, struct symbol *, void *)  callback,
void *  data,
symbol_compare_ftype match 
)
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
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 void print_partial_symbols ( struct gdbarch gdbarch,
struct partial_symbol **  p,
int  count,
char *  what,
struct ui_file outfile 
)
static
static void psym_dump ( struct objfile objfile)
static
static void psym_expand_all_symtabs ( struct objfile objfile)
static

Definition at line 1125 of file psymtab.c.

References ALL_OBJFILE_PSYMTABS_REQUIRED, and psymtab_to_symtab().

static void psym_expand_symtabs_for_function ( struct objfile objfile,
const char *  func_name 
)
static
static void psym_expand_symtabs_matching ( struct objfile objfile,
expand_symtabs_file_matcher_ftype file_matcher,
expand_symtabs_symbol_matcher_ftype symbol_matcher,
expand_symtabs_exp_notify_ftype expansion_notify,
enum search_domain  kind,
void *  data 
)
static
static void psym_expand_symtabs_with_fullname ( struct objfile objfile,
const char *  fullname 
)
static
static struct symtab* psym_find_last_source_symtab ( struct objfile ofp)
static
static struct compunit_symtab* psym_find_pc_sect_compunit_symtab ( struct objfile objfile,
struct bound_minimal_symbol  msymbol,
CORE_ADDR  pc,
struct obj_section section,
int  warn_if_readin 
)
static
static void psym_forget_cached_source_info ( struct objfile objfile)
static

Definition at line 877 of file psymtab.c.

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

static int psym_has_symbols ( struct objfile objfile)
static

Definition at line 1461 of file psymtab.c.

References objfile::psymtabs.

static struct compunit_symtab* psym_lookup_symbol ( struct objfile objfile,
int  block_index,
const char *  name,
const domain_enum  domain 
)
static
static void psym_map_matching_symbols ( struct objfile objfile,
const char *  name,
domain_enum  domain,
int  global,
int(*)(struct block *, struct symbol *, void *)  callback,
void *  data,
symbol_compare_ftype match,
symbol_compare_ftype ordered_compare 
)
static
static void psym_map_symbol_filenames ( struct objfile objfile,
symbol_filename_ftype fun,
void *  data,
int  need_fullname 
)
static
static int psym_map_symtabs_matching_filename ( struct objfile objfile,
const char *  name,
const char *  real_path,
int(*)(struct symtab *, void *)  callback,
void *  data 
)
static
static void psym_print_stats ( struct objfile objfile)
static
static void psym_relocate ( struct objfile objfile,
const struct section_offsets new_offsets,
const struct section_offsets delta 
)
static
void psymbol_bcache_free ( struct psymbol_bcache bcache)

Definition at line 1584 of file psymtab.c.

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

Referenced by free_objfile(), and reread_symbols().

static const struct partial_symbol* psymbol_bcache_full ( struct partial_symbol sym,
struct psymbol_bcache bcache,
int added 
)
static

Definition at line 1607 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)

Definition at line 1596 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  )
static int psymbol_compare ( const void *  addr1,
const void *  addr2,
int  length 
)
static
static unsigned long psymbol_hash ( const void *  addr,
int  length 
)
static
static char* psymtab_search_name ( const char *  name)
static
static const char * psymtab_to_fullname ( struct partial_symtab ps)
static
static struct compunit_symtab * psymtab_to_symtab ( struct objfile objfile,
struct partial_symtab pst 
)
static
static int recursively_search_psymtabs ( struct partial_symtab ps,
struct objfile objfile,
enum search_domain  kind,
expand_symtabs_symbol_matcher_ftype sym_matcher,
void *  data 
)
static
struct objfile* require_partial_symbols ( struct objfile objfile,
int  verbose 
)
void sort_pst_symbols ( struct objfile objfile,
struct partial_symtab pst 
)
struct partial_symtab* start_psymtab_common ( struct objfile objfile,
const char *  filename,
CORE_ADDR  textlow,
struct partial_symbol **  global_syms,
struct partial_symbol **  static_syms 
)

Variable Documentation

initialize_file_ftype _initialize_psymtab
const struct quick_symbol_functions psym_functions
Initial value:
=
{
}
static void psym_expand_all_symtabs(struct objfile *objfile)
Definition: psymtab.c:1125
static struct compunit_symtab * psym_find_pc_sect_compunit_symtab(struct objfile *objfile, struct bound_minimal_symbol msymbol, CORE_ADDR pc, struct obj_section *section, int warn_if_readin)
Definition: psymtab.c:378
static int psym_has_symbols(struct objfile *objfile)
Definition: psymtab.c:1461
static void psym_relocate(struct objfile *objfile, const struct section_offsets *new_offsets, const struct section_offsets *delta)
Definition: psymtab.c:801
static void psym_map_matching_symbols(struct objfile *objfile, const char *name, domain_enum domain, int global, int(*callback)(struct block *, struct symbol *, void *), void *data, symbol_compare_ftype *match, symbol_compare_ftype *ordered_compare)
Definition: psymtab.c:1272
static void psym_forget_cached_source_info(struct objfile *objfile)
Definition: psymtab.c:877
static void psym_dump(struct objfile *objfile)
Definition: psymtab.c:1078
static void psym_map_symbol_filenames(struct objfile *objfile, symbol_filename_ftype *fun, void *data, int need_fullname)
Definition: psymtab.c:1163
static void psym_expand_symtabs_for_function(struct objfile *objfile, const char *func_name)
Definition: psymtab.c:1103
static struct symtab * psym_find_last_source_symtab(struct objfile *ofp)
Definition: psymtab.c:838
static void psym_expand_symtabs_with_fullname(struct objfile *objfile, const char *fullname)
Definition: psymtab.c:1139
static void psym_print_stats(struct objfile *objfile)
Definition: psymtab.c:1060
static struct compunit_symtab * psym_lookup_symbol(struct objfile *objfile, int block_index, const char *name, const domain_enum domain)
Definition: psymtab.c:506
static void psym_expand_symtabs_matching(struct objfile *objfile, expand_symtabs_file_matcher_ftype *file_matcher, expand_symtabs_symbol_matcher_ftype *symbol_matcher, expand_symtabs_exp_notify_ftype *expansion_notify, enum search_domain kind, void *data)
Definition: psymtab.c:1399
static int psym_map_symtabs_matching_filename(struct objfile *objfile, const char *name, const char *real_path, int(*callback)(struct symtab *, void *), void *data)
Definition: psymtab.c:160

Definition at line 1466 of file psymtab.c.