GDB (xrefs)
|
#include "defs.h"
#include <ctype.h>
#include "gdbsupport/gdb_obstack.h"
#include "symtab.h"
#include "buildsym.h"
#include "dictionary.h"
#include "gdbsupport/gdb-safe-ctype.h"
#include <unordered_map>
#include "language.h"
Go to the source code of this file.
Classes | |
struct | dict_vector |
struct | dictionary_hashed |
struct | dictionary_hashed_expandable |
struct | dictionary_linear |
struct | dictionary_linear_expandable |
struct | dictionary |
struct | multidictionary |
struct | std::hash< enum language > |
Namespaces | |
namespace | std |
Macros | |
#define | DICT_VECTOR(d) (d)->vector |
#define | DICT_LANGUAGE(d) (d)->language |
#define | DICT_HASHED_NBUCKETS(d) (d)->data.hashed.nbuckets |
#define | DICT_HASHED_BUCKETS(d) (d)->data.hashed.buckets |
#define | DICT_HASHED_BUCKET(d, i) DICT_HASHED_BUCKETS (d) [i] |
#define | DICT_HASHED_EXPANDABLE_NSYMS(d) (d)->data.hashed_expandable.nsyms |
#define | DICT_LINEAR_NSYMS(d) (d)->data.linear.nsyms |
#define | DICT_LINEAR_SYMS(d) (d)->data.linear.syms |
#define | DICT_LINEAR_SYM(d, i) DICT_LINEAR_SYMS (d) [i] |
#define | DICT_LINEAR_EXPANDABLE_CAPACITY(d) (d)->data.linear_expandable.capacity |
#define | DICT_EXPANDABLE_INITIAL_CAPACITY 10 |
#define | DICT_HASHTABLE_SIZE(n) ((n)/5 + 1) |
#define | DICT_ITERATOR_DICT(iter) (iter)->dict |
#define | DICT_ITERATOR_INDEX(iter) (iter)->index |
#define | DICT_ITERATOR_CURRENT(iter) (iter)->current |
Enumerations | |
enum | dict_type { DICT_HASHED , DICT_HASHED_EXPANDABLE , DICT_LINEAR , DICT_LINEAR_EXPANDABLE } |
Functions | |
static void | add_symbol_nonexpandable (struct dictionary *dict, struct symbol *sym) |
static void | free_obstack (struct dictionary *dict) |
static struct symbol * | iterator_first_hashed (const struct dictionary *dict, struct dict_iterator *iterator) |
static struct symbol * | iterator_next_hashed (struct dict_iterator *iterator) |
static struct symbol * | iter_match_first_hashed (const struct dictionary *dict, const lookup_name_info &name, struct dict_iterator *iterator) |
static struct symbol * | iter_match_next_hashed (const lookup_name_info &name, struct dict_iterator *iterator) |
static int | size_hashed (const struct dictionary *dict) |
static void | free_hashed_expandable (struct dictionary *dict) |
static void | add_symbol_hashed_expandable (struct dictionary *dict, struct symbol *sym) |
static int | size_hashed_expandable (const struct dictionary *dict) |
static struct symbol * | iterator_first_linear (const struct dictionary *dict, struct dict_iterator *iterator) |
static struct symbol * | iterator_next_linear (struct dict_iterator *iterator) |
static struct symbol * | iter_match_first_linear (const struct dictionary *dict, const lookup_name_info &name, struct dict_iterator *iterator) |
static struct symbol * | iter_match_next_linear (const lookup_name_info &name, struct dict_iterator *iterator) |
static int | size_linear (const struct dictionary *dict) |
static void | free_linear_expandable (struct dictionary *dict) |
static void | add_symbol_linear_expandable (struct dictionary *dict, struct symbol *sym) |
static struct symbol * | iterator_hashed_advance (struct dict_iterator *iter) |
static void | insert_symbol_hashed (struct dictionary *dict, struct symbol *sym) |
static void | expand_hashtable (struct dictionary *dict) |
static struct dictionary * | dict_create_hashed (struct obstack *obstack, enum language language, const std::vector< symbol * > &symbol_list) |
static struct dictionary * | dict_create_hashed_expandable (enum language language) |
static struct dictionary * | dict_create_linear (struct obstack *obstack, enum language language, const std::vector< symbol * > &symbol_list) |
static struct dictionary * | dict_create_linear_expandable (enum language language) |
static void | dict_free (struct dictionary *dict) |
static void | dict_add_symbol (struct dictionary *dict, struct symbol *sym) |
static void | dict_add_pending (struct dictionary *dict, const std::vector< symbol * > &symbol_list) |
static struct symbol * | dict_iterator_first (const struct dictionary *dict, struct dict_iterator *iterator) |
static struct symbol * | dict_iterator_next (struct dict_iterator *iterator) |
static struct symbol * | dict_iter_match_first (const struct dictionary *dict, const lookup_name_info &name, struct dict_iterator *iterator) |
static struct symbol * | dict_iter_match_next (const lookup_name_info &name, struct dict_iterator *iterator) |
static int | dict_size (const struct dictionary *dict) |
static std::unordered_map< enum language, std::vector< symbol * > > | collate_pending_symbols_by_language (const struct pending *symbol_list) |
struct multidictionary * | mdict_create_hashed (struct obstack *obstack, const struct pending *symbol_list) |
struct multidictionary * | mdict_create_hashed_expandable (enum language language) |
struct multidictionary * | mdict_create_linear (struct obstack *obstack, const struct pending *symbol_list) |
struct multidictionary * | mdict_create_linear_expandable (enum language language) |
void | mdict_free (struct multidictionary *mdict) |
static struct dictionary * | find_language_dictionary (const struct multidictionary *mdict, enum language language) |
static struct dictionary * | create_new_language_dictionary (struct multidictionary *mdict, enum language language) |
void | mdict_add_symbol (struct multidictionary *mdict, struct symbol *sym) |
void | mdict_add_pending (struct multidictionary *mdict, const struct pending *symbol_list) |
struct symbol * | mdict_iterator_first (const multidictionary *mdict, struct mdict_iterator *miterator) |
struct symbol * | mdict_iterator_next (struct mdict_iterator *miterator) |
struct symbol * | mdict_iter_match_first (const struct multidictionary *mdict, const lookup_name_info &name, struct mdict_iterator *miterator) |
struct symbol * | mdict_iter_match_next (const lookup_name_info &name, struct mdict_iterator *miterator) |
int | mdict_size (const struct multidictionary *mdict) |
Variables | |
static const struct dict_vector | dict_hashed_vector |
static const struct dict_vector | dict_hashed_expandable_vector |
static const struct dict_vector | dict_linear_vector |
static const struct dict_vector | dict_linear_expandable_vector |
#define DICT_EXPANDABLE_INITIAL_CAPACITY 10 |
Definition at line 205 of file dictionary.c.
Referenced by dict_create_hashed_expandable(), and dict_create_linear_expandable().
#define DICT_HASHED_BUCKET | ( | d, | |
i ) DICT_HASHED_BUCKETS (d) [i] |
Definition at line 190 of file dictionary.c.
Referenced by iter_match_first_hashed(), iterator_hashed_advance(), and size_hashed().
#define DICT_HASHED_BUCKETS | ( | d | ) | (d)->data.hashed.buckets |
Definition at line 189 of file dictionary.c.
Referenced by dict_create_hashed(), dict_create_hashed_expandable(), expand_hashtable(), free_hashed_expandable(), and insert_symbol_hashed().
#define DICT_HASHED_EXPANDABLE_NSYMS | ( | d | ) | (d)->data.hashed_expandable.nsyms |
Definition at line 192 of file dictionary.c.
Referenced by add_symbol_hashed_expandable(), dict_create_hashed_expandable(), and size_hashed_expandable().
#define DICT_HASHED_NBUCKETS | ( | d | ) | (d)->data.hashed.nbuckets |
Definition at line 188 of file dictionary.c.
Referenced by add_symbol_hashed_expandable(), dict_create_hashed(), dict_create_hashed_expandable(), expand_hashtable(), insert_symbol_hashed(), iter_match_first_hashed(), iterator_hashed_advance(), and size_hashed().
#define DICT_HASHTABLE_SIZE | ( | n | ) | ((n)/5 + 1) |
Definition at line 210 of file dictionary.c.
Referenced by add_symbol_hashed_expandable(), and dict_create_hashed().
#define DICT_ITERATOR_CURRENT | ( | iter | ) | (iter)->current |
Definition at line 223 of file dictionary.c.
Referenced by iter_match_first_hashed(), iter_match_next_hashed(), iterator_hashed_advance(), and iterator_next_hashed().
#define DICT_ITERATOR_DICT | ( | iter | ) | (iter)->dict |
Definition at line 217 of file dictionary.c.
Referenced by dict_iter_match_next(), dict_iterator_next(), iter_match_first_hashed(), iter_match_first_linear(), iter_match_next_hashed(), iter_match_next_linear(), iterator_first_hashed(), iterator_first_linear(), iterator_hashed_advance(), and iterator_next_linear().
#define DICT_ITERATOR_INDEX | ( | iter | ) | (iter)->index |
Definition at line 220 of file dictionary.c.
Referenced by iter_match_first_linear(), iter_match_next_linear(), iterator_first_hashed(), iterator_first_linear(), iterator_hashed_advance(), and iterator_next_linear().
#define DICT_LANGUAGE | ( | d | ) | (d)->language |
Definition at line 184 of file dictionary.c.
Referenced by dict_create_hashed(), dict_create_hashed_expandable(), dict_create_linear(), dict_create_linear_expandable(), find_language_dictionary(), insert_symbol_hashed(), iter_match_first_hashed(), iter_match_next_hashed(), and iter_match_next_linear().
#define DICT_LINEAR_EXPANDABLE_CAPACITY | ( | d | ) | (d)->data.linear_expandable.capacity |
Definition at line 200 of file dictionary.c.
Referenced by add_symbol_linear_expandable(), and dict_create_linear_expandable().
#define DICT_LINEAR_NSYMS | ( | d | ) | (d)->data.linear.nsyms |
Definition at line 196 of file dictionary.c.
Referenced by add_symbol_linear_expandable(), dict_create_linear(), dict_create_linear_expandable(), iter_match_next_linear(), iterator_first_linear(), iterator_next_linear(), and size_linear().
#define DICT_LINEAR_SYM | ( | d, | |
i ) DICT_LINEAR_SYMS (d) [i] |
Definition at line 198 of file dictionary.c.
Referenced by add_symbol_linear_expandable(), iter_match_next_linear(), iterator_first_linear(), and iterator_next_linear().
#define DICT_LINEAR_SYMS | ( | d | ) | (d)->data.linear.syms |
Definition at line 197 of file dictionary.c.
Referenced by add_symbol_linear_expandable(), dict_create_linear(), dict_create_linear_expandable(), and free_linear_expandable().
#define DICT_VECTOR | ( | d | ) | (d)->vector |
Definition at line 183 of file dictionary.c.
Referenced by dict_add_symbol(), dict_create_hashed(), dict_create_hashed_expandable(), dict_create_linear(), dict_create_linear_expandable(), dict_free(), dict_iter_match_first(), dict_iter_match_next(), dict_iterator_first(), dict_iterator_next(), and dict_size().
enum dict_type |
Enumerator | |
---|---|
DICT_HASHED | |
DICT_HASHED_EXPANDABLE | |
DICT_LINEAR | |
DICT_LINEAR_EXPANDABLE |
Definition at line 92 of file dictionary.c.
|
static |
Definition at line 677 of file dictionary.c.
References DICT_HASHED_EXPANDABLE_NSYMS, DICT_HASHED_NBUCKETS, DICT_HASHTABLE_SIZE, expand_hashtable(), and insert_symbol_hashed().
|
static |
Definition at line 886 of file dictionary.c.
References DICT_LINEAR_EXPANDABLE_CAPACITY, DICT_LINEAR_NSYMS, DICT_LINEAR_SYM, and DICT_LINEAR_SYMS.
|
static |
Definition at line 523 of file dictionary.c.
|
static |
Definition at line 939 of file dictionary.c.
References pending::next.
Referenced by mdict_add_pending(), mdict_create_hashed(), and mdict_create_linear().
|
static |
Definition at line 1095 of file dictionary.c.
References dict_create_hashed_expandable(), dict_create_linear_expandable(), DICT_HASHED, DICT_HASHED_EXPANDABLE, DICT_LINEAR, DICT_LINEAR_EXPANDABLE, multidictionary::dictionaries, multidictionary::n_allocated_dictionaries, dict_vector::type, dictionary::vector, and xrealloc().
Referenced by mdict_add_pending(), and mdict_add_symbol().
|
static |
Definition at line 457 of file dictionary.c.
References dict_add_symbol().
Referenced by mdict_add_pending().
|
static |
Definition at line 448 of file dictionary.c.
References add_symbol(), and DICT_VECTOR.
Referenced by dict_add_pending(), and mdict_add_symbol().
|
static |
Definition at line 351 of file dictionary.c.
References DICT_HASHED_BUCKETS, DICT_HASHED_NBUCKETS, dict_hashed_vector, DICT_HASHTABLE_SIZE, DICT_LANGUAGE, DICT_VECTOR, insert_symbol_hashed(), language_def(), and general_symbol_info::obstack.
Referenced by mdict_create_hashed().
|
static |
Definition at line 378 of file dictionary.c.
References DICT_EXPANDABLE_INITIAL_CAPACITY, DICT_HASHED_BUCKETS, DICT_HASHED_EXPANDABLE_NSYMS, dict_hashed_expandable_vector, DICT_HASHED_NBUCKETS, DICT_LANGUAGE, DICT_VECTOR, and language_def().
Referenced by create_new_language_dictionary(), and mdict_create_hashed_expandable().
|
static |
Definition at line 395 of file dictionary.c.
References DICT_LANGUAGE, DICT_LINEAR_NSYMS, DICT_LINEAR_SYMS, dict_linear_vector, DICT_VECTOR, language_def(), and general_symbol_info::obstack.
Referenced by mdict_create_linear().
|
static |
Definition at line 420 of file dictionary.c.
References DICT_EXPANDABLE_INITIAL_CAPACITY, DICT_LANGUAGE, DICT_LINEAR_EXPANDABLE_CAPACITY, dict_linear_expandable_vector, DICT_LINEAR_NSYMS, DICT_LINEAR_SYMS, DICT_VECTOR, and language_def().
Referenced by create_new_language_dictionary(), and mdict_create_linear_expandable().
|
static |
|
static |
Definition at line 486 of file dictionary.c.
References DICT_VECTOR, and name.
Referenced by mdict_iter_match_first(), and mdict_iter_match_next().
|
static |
Definition at line 494 of file dictionary.c.
References DICT_ITERATOR_DICT, DICT_VECTOR, and name.
Referenced by mdict_iter_match_next().
|
static |
Definition at line 469 of file dictionary.c.
References DICT_VECTOR.
Referenced by mdict_iterator_first(), and mdict_iterator_next().
|
static |
Definition at line 479 of file dictionary.c.
References DICT_ITERATOR_DICT, and DICT_VECTOR.
Referenced by mdict_iterator_next().
|
static |
|
static |
Definition at line 696 of file dictionary.c.
References DICT_HASHED_BUCKETS, DICT_HASHED_NBUCKETS, symbol::hash_next, insert_symbol_hashed(), and xfree().
Referenced by add_symbol_hashed_expandable().
|
static |
Definition at line 1077 of file dictionary.c.
References DICT_LANGUAGE, multidictionary::dictionaries, and multidictionary::n_allocated_dictionaries.
Referenced by mdict_add_pending(), and mdict_add_symbol().
|
static |
Definition at line 670 of file dictionary.c.
References DICT_HASHED_BUCKETS, and xfree().
|
static |
Definition at line 878 of file dictionary.c.
References DICT_LINEAR_SYMS, and xfree().
|
static |
Definition at line 517 of file dictionary.c.
|
static |
Definition at line 633 of file dictionary.c.
References DICT_HASHED_BUCKETS, DICT_HASHED_NBUCKETS, DICT_LANGUAGE, symbol::hash_next, general_symbol_info::language(), general_symbol_info::search_name(), and search_name_hash().
Referenced by add_symbol_hashed_expandable(), dict_create_hashed(), and expand_hashtable().
|
static |
Definition at line 578 of file dictionary.c.
References DICT_HASHED_BUCKET, DICT_HASHED_NBUCKETS, DICT_ITERATOR_CURRENT, DICT_ITERATOR_DICT, DICT_LANGUAGE, language_defn::get_symbol_name_matcher(), symbol::hash_next, language_defn::la_language, name, and general_symbol_info::search_name().
|
static |
Definition at line 831 of file dictionary.c.
References DICT_ITERATOR_DICT, DICT_ITERATOR_INDEX, iter_match_next_linear(), and name.
|
static |
Definition at line 609 of file dictionary.c.
References DICT_ITERATOR_CURRENT, DICT_ITERATOR_DICT, DICT_LANGUAGE, language_defn::get_symbol_name_matcher(), symbol::hash_next, and name.
|
static |
Definition at line 842 of file dictionary.c.
References DICT_ITERATOR_DICT, DICT_ITERATOR_INDEX, DICT_LANGUAGE, DICT_LINEAR_NSYMS, DICT_LINEAR_SYM, language_defn::get_symbol_name_matcher(), name, and general_symbol_info::search_name().
Referenced by iter_match_first_linear().
|
static |
Definition at line 531 of file dictionary.c.
References DICT_ITERATOR_DICT, DICT_ITERATOR_INDEX, and iterator_hashed_advance().
|
static |
Definition at line 811 of file dictionary.c.
References DICT_ITERATOR_DICT, DICT_ITERATOR_INDEX, DICT_LINEAR_NSYMS, and DICT_LINEAR_SYM.
|
static |
Definition at line 556 of file dictionary.c.
References DICT_HASHED_BUCKET, DICT_HASHED_NBUCKETS, DICT_ITERATOR_CURRENT, DICT_ITERATOR_DICT, and DICT_ITERATOR_INDEX.
Referenced by iterator_first_hashed(), and iterator_next_hashed().
|
static |
Definition at line 540 of file dictionary.c.
References DICT_ITERATOR_CURRENT, symbol::hash_next, and iterator_hashed_advance().
|
static |
Definition at line 820 of file dictionary.c.
References DICT_ITERATOR_DICT, DICT_ITERATOR_INDEX, DICT_LINEAR_NSYMS, and DICT_LINEAR_SYM.
void mdict_add_pending | ( | struct multidictionary * | mdict, |
const struct pending * | symbol_list ) |
Definition at line 1150 of file dictionary.c.
References collate_pending_symbols_by_language(), create_new_language_dictionary(), dict_add_pending(), and find_language_dictionary().
Referenced by buildsym_compunit::augment_type_symtab(), and buildsym_compunit::finish_block_internal().
void mdict_add_symbol | ( | struct multidictionary * | mdict, |
struct symbol * | sym ) |
Definition at line 1132 of file dictionary.c.
References create_new_language_dictionary(), dict_add_symbol(), find_language_dictionary(), and general_symbol_info::language().
Referenced by add_symbol().
struct multidictionary * mdict_create_hashed | ( | struct obstack * | obstack, |
const struct pending * | symbol_list ) |
Definition at line 959 of file dictionary.c.
References collate_pending_symbols_by_language(), dict_create_hashed(), multidictionary::dictionaries, and multidictionary::n_allocated_dictionaries.
Referenced by buildsym_compunit::finish_block_internal().
struct multidictionary * mdict_create_hashed_expandable | ( | enum language language language | ) |
Definition at line 988 of file dictionary.c.
References dict_create_hashed_expandable(), multidictionary::dictionaries, and multidictionary::n_allocated_dictionaries.
Referenced by buildsym_compunit::finish_block_internal(), and new_block().
struct multidictionary * mdict_create_linear | ( | struct obstack * | obstack, |
const struct pending * | symbol_list ) |
Definition at line 1004 of file dictionary.c.
References collate_pending_symbols_by_language(), dict_create_linear(), multidictionary::dictionaries, and multidictionary::n_allocated_dictionaries.
Referenced by finalize_symtab(), and buildsym_compunit::finish_block_internal().
struct multidictionary * mdict_create_linear_expandable | ( | enum language language language | ) |
Definition at line 1033 of file dictionary.c.
References dict_create_linear_expandable(), multidictionary::dictionaries, and multidictionary::n_allocated_dictionaries.
Referenced by new_block().
void mdict_free | ( | struct multidictionary * | mdict | ) |
Definition at line 1049 of file dictionary.c.
References dict_free(), DICT_HASHED, DICT_HASHED_EXPANDABLE, DICT_LINEAR, DICT_LINEAR_EXPANDABLE, multidictionary::dictionaries, multidictionary::n_allocated_dictionaries, dict_vector::type, dictionary::vector, and xfree().
struct symbol * mdict_iter_match_first | ( | const struct multidictionary * | mdict, |
const lookup_name_info & | name, | ||
struct mdict_iterator * | miterator ) |
Definition at line 1229 of file dictionary.c.
References mdict_iterator::current_idx, dict_iter_match_first(), multidictionary::dictionaries, mdict_iterator::iterator, mdict_iterator::mdict, multidictionary::n_allocated_dictionaries, and name.
Referenced by block_iter_match_step(), block_iterator_first(), and block_lookup_symbol_primary().
struct symbol * mdict_iter_match_next | ( | const lookup_name_info & | name, |
struct mdict_iterator * | miterator ) |
Definition at line 1253 of file dictionary.c.
References mdict_iterator::current_idx, dict_iter_match_first(), dict_iter_match_next(), multidictionary::dictionaries, mdict_iterator::iterator, mdict_iterator::mdict, multidictionary::n_allocated_dictionaries, and name.
Referenced by block_iter_match_step(), block_iterator_next(), and block_lookup_symbol_primary().
struct symbol * mdict_iterator_first | ( | const multidictionary * | mdict, |
struct mdict_iterator * | miterator ) |
Definition at line 1176 of file dictionary.c.
References mdict_iterator::current_idx, dict_iterator_first(), multidictionary::dictionaries, mdict_iterator::iterator, mdict_iterator::mdict, and multidictionary::n_allocated_dictionaries.
Referenced by block_iterator_first(), and block_iterator_step().
struct symbol * mdict_iterator_next | ( | struct mdict_iterator * | miterator | ) |
Definition at line 1201 of file dictionary.c.
References mdict_iterator::current_idx, dict_iterator_first(), dict_iterator_next(), multidictionary::dictionaries, mdict_iterator::iterator, mdict_iterator::mdict, and multidictionary::n_allocated_dictionaries.
Referenced by block_iterator_next(), block_iterator_step(), and mdict_iterator_wrapper::operator++().
int mdict_size | ( | const struct multidictionary * | mdict | ) |
Definition at line 1283 of file dictionary.c.
References dict_size(), multidictionary::dictionaries, multidictionary::n_allocated_dictionaries, and size.
Referenced by blpy_repr(), and dump_symtab_1().
|
static |
Definition at line 651 of file dictionary.c.
References DICT_HASHED_BUCKET, DICT_HASHED_NBUCKETS, and symbol::hash_next.
|
static |
Definition at line 690 of file dictionary.c.
References DICT_HASHED_EXPANDABLE_NSYMS.
|
static |
Definition at line 870 of file dictionary.c.
References DICT_LINEAR_NSYMS.
|
static |
Definition at line 300 of file dictionary.c.
Referenced by dict_create_hashed_expandable().
|
static |
Definition at line 288 of file dictionary.c.
Referenced by dict_create_hashed().
|
static |
Definition at line 324 of file dictionary.c.
Referenced by dict_create_linear_expandable().
|
static |
Definition at line 312 of file dictionary.c.
Referenced by dict_create_linear().