GDB (xrefs)
|
#include "defs.h"
#include "bfd.h"
#include "gdb_obstack.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdbtypes.h"
#include "gdb_assert.h"
#include "complaints.h"
#include "gdb_string.h"
#include "expression.h"
#include "bcache.h"
#include "filenames.h"
#include "macrotab.h"
#include "demangle.h"
#include "block.h"
#include "cp-support.h"
#include "dictionary.h"
#include "addrmap.h"
#include "buildsym.h"
#include "stabsread.h"
Go to the source code of this file.
#define EXTERN |
Definition at line 47 of file buildsym.c.
#define INITIAL_CONTEXT_STACK_SIZE 10 |
Definition at line 128 of file buildsym.c.
Referenced by restart_symtab().
#define INITIAL_LINE_VECTOR_LENGTH 1000 |
Definition at line 129 of file buildsym.c.
Referenced by record_line().
void add_symbol_to_list | ( | struct symbol * | symbol, |
struct pending ** | listhead | ||
) |
Definition at line 137 of file buildsym.c.
References free_pendings, symbol::ginfo, general_symbol_info::name, pending::next, pending::nsyms, PENDINGSIZE, pending::symbol, and xmalloc().
Referenced by coff_read_enum_type(), common_block_end(), define_symbol(), fixup_go_packaging(), merge_symbol_lists(), new_symbol_full(), patch_block_stabs(), process_coff_symbol(), process_xcoff_symbol(), psymtab_to_symtab_1(), and read_enum_type().
void augment_type_symtab | ( | struct objfile * | objfile, |
struct symtab * | primary_symtab | ||
) |
Definition at line 1392 of file buildsym.c.
References _, BLOCK_DICT, symtab::blockvector, BLOCKVECTOR_BLOCK, complaint(), context_stack_depth, dict_add_pending(), file_symbols, GLOBAL_BLOCK, global_symbols, have_line_numbers, reset_symtab_globals(), set_missing_symtab(), STATIC_BLOCK, and symfile_complaints.
Referenced by process_full_type_unit().
static int block_compar | ( | const void * | ap, |
const void * | bp | ||
) | [static] |
Definition at line 984 of file buildsym.c.
References BLOCK_START.
Referenced by end_symtab_get_static_block().
void buildsym_init | ( | void | ) |
Definition at line 1558 of file buildsym.c.
References file_symbols, gdb_assert, global_symbols, pending_addrmap_interesting, and using_directives.
Referenced by buildsym_new_init(), dbx_psymtab_to_symtab_1(), process_full_comp_unit(), process_full_type_unit(), and xcoff_psymtab_to_symtab_1().
void buildsym_new_init | ( | void | ) |
Definition at line 1578 of file buildsym.c.
References buildsym_init().
Referenced by coffstab_build_psymtabs(), dbx_new_init(), elf_new_init(), elfstab_build_psymtabs(), mdebug_build_psymtabs(), mipscoff_new_init(), som_new_init(), stabsect_build_psymtabs(), and xcoff_new_init().
static int compare_line_numbers | ( | const void * | ln1p, |
const void * | ln2p | ||
) | [static] |
Definition at line 821 of file buildsym.c.
References linetable_entry::line, and linetable_entry::pc.
Referenced by end_symtab_from_static_block().
struct symtab* end_expandable_symtab | ( | CORE_ADDR | end_addr, |
struct objfile * | objfile, | ||
int | section | ||
) | [read] |
Definition at line 1359 of file buildsym.c.
References end_symtab_from_static_block(), and end_symtab_get_static_block().
Referenced by process_full_type_unit().
struct symtab* end_symtab | ( | CORE_ADDR | end_addr, |
struct objfile * | objfile, | ||
int | section | ||
) | [read] |
Definition at line 1348 of file buildsym.c.
References end_symtab_from_static_block(), and end_symtab_get_static_block().
Referenced by coff_end_symtab(), process_one_symbol(), psymtab_to_symtab_1(), read_ofile_symtab(), and read_xcoff_symtab().
struct symtab* end_symtab_from_static_block | ( | struct block * | static_block, |
struct objfile * | objfile, | ||
int | section, | ||
int | expandable | ||
) | [read] |
Definition at line 1121 of file buildsym.c.
References ALL_DICT_SYMBOLS, ALL_OBJFILE_SYMTABS, allocate_symtab(), BLOCK_DICT, BLOCK_END, BLOCK_FUNCTION, symtab::block_line_section, symtab::blockvector, BLOCKVECTOR_BLOCK, BLOCKVECTOR_NBLOCKS, compare_line_numbers(), subfile::debugformat, symtab::debugformat, subfile::dirname, symtab::dirname, finish_block_internal(), objfile::flags, GLOBAL_BLOCK, global_symbols, linetable::item, subfile::language, symtab::language, last_source_start_addr, subfile::line_vector, symtab::linetable, symtab::macro_table, make_blockvector(), memcpy(), subfile::name, subfile::next, symtab::next, linetable::nitems, OBJF_REORDERED, objfile::objfile_obstack, pending_macros, symtab::primary, subfile::producer, symtab::producer, qsort, reset_symtab_globals(), set_block_symtab(), objfile::sf, sym_fns::sym_read_linetable, SYMBOL_SYMTAB, subfile::symtab, objfile::symtabs, watch_main_source_file_lossage(), and xfree().
Referenced by end_expandable_symtab(), end_symtab(), and process_full_comp_unit().
struct block* end_symtab_get_static_block | ( | CORE_ADDR | end_addr, |
struct objfile * | objfile, | ||
int | expandable, | ||
int | required | ||
) | [read] |
Definition at line 1023 of file buildsym.c.
References _, pending_block::block, block_compar(), cleanup_undefined_stabs_types(), complaint(), context_stack_depth, do_cleanups(), file_symbols, finish_block(), finish_block_internal(), finish_global_stabs(), objfile::flags, global_symbols, have_line_numbers, last_source_start_addr, local_symbols, make_cleanup(), context_stack::name, pending_block::next, OBJF_REORDERED, context_stack::old_blocks, pop_context(), qsort, context_stack::start_addr, symfile_complaints, xfree(), and xmalloc().
Referenced by end_expandable_symtab(), end_symtab(), and process_full_comp_unit().
struct symbol* find_symbol_in_list | ( | struct pending * | list, |
char * | name, | ||
int | length | ||
) | [read] |
Definition at line 171 of file buildsym.c.
References pending::next, pending::nsyms, pending::symbol, and SYMBOL_LINKAGE_NAME.
Referenced by patch_block_stabs().
struct block* finish_block | ( | struct symbol * | symbol, |
struct pending ** | listhead, | ||
struct pending_block * | old_blocks, | ||
CORE_ADDR | start, | ||
CORE_ADDR | end, | ||
struct objfile * | objfile | ||
) | [read] |
Definition at line 431 of file buildsym.c.
References finish_block_internal().
Referenced by coff_symtab_read(), end_symtab_get_static_block(), process_one_symbol(), read_func_scope(), read_lexical_block_scope(), and read_xcoff_symtab().
static struct block* finish_block_internal | ( | struct symbol * | symbol, |
struct pending ** | listhead, | ||
struct pending_block * | old_blocks, | ||
CORE_ADDR | start, | ||
CORE_ADDR | end, | ||
struct objfile * | objfile, | ||
int | is_global, | ||
int | expandable | ||
) | [static, read] |
Definition at line 250 of file buildsym.c.
References _, ALL_DICT_SYMBOLS, allocate_block(), allocate_global_block(), pending_block::block, BLOCK_DICT, BLOCK_END, BLOCK_FUNCTION, block_set_using(), BLOCK_START, BLOCK_SUPERBLOCK, complaint(), dict_add_pending(), dict_create_hashed(), dict_create_hashed_expandable(), dict_create_linear(), free_pendings, get_objfile_arch(), pending_block::next, pending::next, objfile::objfile_obstack, paddress(), record_pending_block(), SYMBOL_BLOCK_VALUE, SYMBOL_IS_ARGUMENT, SYMBOL_PRINT_NAME, SYMBOL_TYPE, symfile_complaints, TYPE_ALLOC, TYPE_FIELD_ARTIFICIAL, TYPE_FIELD_TYPE, TYPE_FIELDS, TYPE_NFIELDS, and using_directives.
Referenced by end_symtab_from_static_block(), end_symtab_get_static_block(), and finish_block().
void free_pending_blocks | ( | void | ) |
Definition at line 236 of file buildsym.c.
References pending_block_obstack.
Referenced by dbx_symfile_read(), make_blockvector(), really_free_pendings(), and xcoff_initial_scan().
const char* get_last_source_file | ( | void | ) |
Definition at line 1546 of file buildsym.c.
References last_source_file.
Referenced by coff_symtab_read(), process_linenos(), process_one_symbol(), psymtab_to_symtab_1(), and read_xcoff_symtab().
struct macro_table* get_macro_table | ( | struct objfile * | objfile, |
const char * | comp_dir | ||
) | [read] |
Definition at line 843 of file buildsym.c.
References objfile_per_bfd_storage::macro_cache, new_macro_table(), pending_macros, objfile::per_bfd, and objfile_per_bfd_storage::storage_obstack.
Referenced by macro_start_file().
Definition at line 1481 of file buildsym.c.
References hash(), and HASHSIZE.
Referenced by common_block_end(), define_symbol(), parse_symbol(), patch_opaque_types(), process_coff_symbol(), and scan_file_globals().
static struct blockvector* make_blockvector | ( | struct objfile * | objfile | ) | [static, read] |
Definition at line 504 of file buildsym.c.
References _, addrmap_create_fixed(), pending_block::block, BLOCK_START, BLOCKVECTOR_BLOCK, BLOCKVECTOR_MAP, BLOCKVECTOR_NBLOCKS, complaint(), free_pending_blocks(), hex_string(), LONGEST, pending_block::next, objfile::objfile_obstack, pending_addrmap_interesting, and symfile_complaints.
Referenced by end_symtab_from_static_block().
void merge_symbol_lists | ( | struct pending ** | srclist, |
struct pending ** | targetlist | ||
) |
Definition at line 1508 of file buildsym.c.
References add_symbol_to_list(), free_pendings, and merge_symbol_lists().
Referenced by merge_symbol_lists().
void patch_subfile_names | ( | struct subfile * | subfile, |
char * | name | ||
) |
Definition at line 688 of file buildsym.c.
References deduce_language_from_filename(), subfile::dirname, subfile::language, language_unknown, subfile::name, subfile::next, and set_last_source_file().
Referenced by process_one_symbol().
struct context_stack* pop_context | ( | void | ) | [read] |
Definition at line 1470 of file buildsym.c.
References context_stack_depth, and gdb_assert.
Referenced by coff_symtab_read(), end_symtab_get_static_block(), process_one_symbol(), read_func_scope(), read_lexical_block_scope(), and read_xcoff_symtab().
char* pop_subfile | ( | void | ) |
Definition at line 739 of file buildsym.c.
References _, internal_error(), name, subfile_stack::name, subfile_stack::next, subfile_stack, and xfree().
Referenced by process_linenos(), and process_one_symbol().
struct context_stack* push_context | ( | int | desc, |
CORE_ADDR | valu | ||
) | [read] |
Definition at line 1440 of file buildsym.c.
References context_stack, context_stack_depth, context_stack_size, context_stack::depth, local_symbols, pending_blocks, using_directives, and xrealloc().
Referenced by coff_symtab_read(), process_one_symbol(), read_func_scope(), read_lexical_block_scope(), and read_xcoff_symtab().
void push_subfile | ( | void | ) |
Definition at line 723 of file buildsym.c.
References _, current_subfile, internal_error(), subfile::name, subfile_stack::name, subfile_stack::next, subfile_stack, and xmalloc().
Referenced by process_linenos(), and process_one_symbol().
void really_free_pendings | ( | void * | dummy | ) |
Definition at line 196 of file buildsym.c.
References file_symbols, free_macro_table(), free_pending_blocks(), global_symbols, pending::next, pending_addrmap_obstack, and xfree().
Referenced by dbx_psymtab_to_symtab_1(), dbx_symfile_read(), process_full_comp_unit(), process_full_type_unit(), xcoff_initial_scan(), and xcoff_psymtab_to_symtab_1().
void record_block_range | ( | struct block * | block, |
CORE_ADDR | start, | ||
CORE_ADDR | end_inclusive | ||
) |
Definition at line 481 of file buildsym.c.
References addrmap_create_mutable(), addrmap_set_empty(), BLOCK_END, BLOCK_START, pending_addrmap_interesting, and pending_addrmap_obstack.
Referenced by dwarf2_record_block_ranges().
void record_debugformat | ( | const char * | format | ) |
Definition at line 1488 of file buildsym.c.
References current_subfile, and subfile::debugformat.
Referenced by coff_start_symtab(), dwarf2_start_symtab(), process_one_symbol(), and read_xcoff_symtab().
void record_line | ( | struct subfile * | subfile, |
int | line, | ||
CORE_ADDR | pc | ||
) |
Definition at line 759 of file buildsym.c.
References have_line_numbers, INITIAL_LINE_VECTOR_LENGTH, linetable::item, linetable_entry::line, line, subfile::line_vector, subfile::line_vector_length, linetable::nitems, linetable_entry::pc, xmalloc(), and xrealloc().
Referenced by coff_symtab_read(), dwarf_decode_lines_1(), enter_line_range(), enter_linenos(), process_one_symbol(), and psymtab_to_symtab_1().
static void record_pending_block | ( | struct objfile * | objfile, |
struct block * | block, | ||
struct pending_block * | opblock | ||
) | [static] |
Definition at line 448 of file buildsym.c.
References pending_block::block, pending_block::next, pending_block_obstack, and pending_blocks.
Referenced by finish_block_internal().
void record_producer | ( | const char * | producer | ) |
Definition at line 1494 of file buildsym.c.
References current_subfile, and subfile::producer.
Referenced by dwarf2_start_symtab().
static void reset_symtab_globals | ( | void | ) | [static] |
Definition at line 996 of file buildsym.c.
References current_subfile, pending_addrmap_obstack, and set_last_source_file().
Referenced by augment_type_symtab(), and end_symtab_from_static_block().
void restart_symtab | ( | CORE_ADDR | start_addr | ) |
Definition at line 875 of file buildsym.c.
References context_stack_depth, context_stack_size, current_subfile, file_symbols, gdb_assert, global_symbols, have_line_numbers, INITIAL_CONTEXT_STACK_SIZE, last_source_start_addr, set_last_source_file(), within_function, and xmalloc().
Referenced by setup_type_unit_groups(), and start_symtab().
void set_last_source_file | ( | const char * | name | ) |
Definition at line 1537 of file buildsym.c.
References last_source_file, and xfree().
Referenced by coff_end_symtab(), coff_symtab_read(), complete_symtab(), parse_partial_symbols(), patch_subfile_names(), read_dbx_symtab(), read_ofile_symtab(), read_xcoff_symtab(), reset_symtab_globals(), restart_symtab(), scan_xcoff_symtab(), and start_symtab().
static void set_missing_symtab | ( | struct pending * | pending_list, |
struct symtab * | symtab | ||
) | [static] |
Definition at line 1372 of file buildsym.c.
References pending::next, pending::nsyms, pending::symbol, and SYMBOL_SYMTAB.
Referenced by augment_type_symtab().
void start_subfile | ( | const char * | name, |
const char * | dirname | ||
) |
Definition at line 575 of file buildsym.c.
References current_subfile, deduce_language_from_filename(), subfile::dirname, subfile::language, language_c, language_cplus, language_fortran, language_unknown, memset(), subfile::name, subfile::next, subfiles, xfree(), and xmalloc().
Referenced by dwarf2_start_subfile(), process_linenos(), process_one_symbol(), and start_symtab().
void start_symtab | ( | const char * | name, |
const char * | dirname, | ||
CORE_ADDR | start_addr | ||
) |
Definition at line 862 of file buildsym.c.
References restart_symtab(), set_last_source_file(), and start_subfile().
Referenced by coff_start_symtab(), dwarf2_start_symtab(), process_one_symbol(), and read_xcoff_symtab().
static void watch_main_source_file_lossage | ( | void | ) | [static] |
Definition at line 913 of file buildsym.c.
References gdb_assert, subfile::line_vector, subfile::line_vector_length, subfile::name, subfile::next, subfile::symtab, and xfree().
Referenced by end_symtab_from_static_block().
struct pending* free_pendings [static] |
Definition at line 63 of file buildsym.c.
Referenced by add_symbol_to_list(), finish_block_internal(), and merge_symbol_lists().
int have_line_numbers [static] |
Definition at line 68 of file buildsym.c.
Referenced by augment_type_symtab(), end_symtab_get_static_block(), record_line(), and restart_symtab().
char* last_source_file [static] |
Definition at line 1532 of file buildsym.c.
Referenced by get_last_source_file(), and set_last_source_file().
struct addrmap* pending_addrmap [static] |
Definition at line 73 of file buildsym.c.
int pending_addrmap_interesting [static] |
Definition at line 84 of file buildsym.c.
Referenced by buildsym_init(), make_blockvector(), and record_block_range().
struct obstack pending_addrmap_obstack [static] |
Definition at line 78 of file buildsym.c.
Referenced by really_free_pendings(), record_block_range(), and reset_symtab_globals().
struct obstack pending_block_obstack [static] |
Definition at line 88 of file buildsym.c.
Referenced by free_pending_blocks(), and record_pending_block().
struct pending_block* pending_blocks [static] |
Definition at line 104 of file buildsym.c.
Referenced by push_context(), and record_pending_block().
struct macro_table* pending_macros [static] |
Definition at line 116 of file buildsym.c.
Referenced by end_symtab_from_static_block(), and get_macro_table().
struct subfile_stack* subfile_stack [static] |
Definition at line 112 of file buildsym.c.
Referenced by pop_subfile(), and push_subfile().
Definition at line 59 of file buildsym.c.
Referenced by start_subfile().