GDB (xrefs)
Classes | Defines | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/dictionary.c File Reference
#include "defs.h"
#include <ctype.h>
#include "gdb_obstack.h"
#include "symtab.h"
#include "buildsym.h"
#include "gdb_assert.h"
#include "dictionary.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

Defines

#define DICT_VECTOR(d)   (d)->vector
#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 symboliterator_first_hashed (const struct dictionary *dict, struct dict_iterator *iterator)
static struct symboliterator_next_hashed (struct dict_iterator *iterator)
static struct symboliter_match_first_hashed (const struct dictionary *dict, const char *name, symbol_compare_ftype *compare, struct dict_iterator *iterator)
static struct symboliter_match_next_hashed (const char *name, symbol_compare_ftype *compare, struct dict_iterator *iterator)
static unsigned int dict_hash (const char *string)
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 symboliterator_first_linear (const struct dictionary *dict, struct dict_iterator *iterator)
static struct symboliterator_next_linear (struct dict_iterator *iterator)
static struct symboliter_match_first_linear (const struct dictionary *dict, const char *name, symbol_compare_ftype *compare, struct dict_iterator *iterator)
static struct symboliter_match_next_linear (const char *name, symbol_compare_ftype *compare, 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 symboliterator_hashed_advance (struct dict_iterator *iter)
static void insert_symbol_hashed (struct dictionary *dict, struct symbol *sym)
static void expand_hashtable (struct dictionary *dict)
struct dictionarydict_create_hashed (struct obstack *obstack, const struct pending *symbol_list)
struct dictionarydict_create_hashed_expandable (void)
struct dictionarydict_create_linear (struct obstack *obstack, const struct pending *symbol_list)
struct dictionarydict_create_linear_expandable (void)
void dict_free (struct dictionary *dict)
void dict_add_symbol (struct dictionary *dict, struct symbol *sym)
void dict_add_pending (struct dictionary *dict, const struct pending *symbol_list)
struct symboldict_iterator_first (const struct dictionary *dict, struct dict_iterator *iterator)
struct symboldict_iterator_next (struct dict_iterator *iterator)
struct symboldict_iter_name_first (const struct dictionary *dict, const char *name, struct dict_iterator *iterator)
struct symboldict_iter_name_next (const char *name, struct dict_iterator *iterator)
struct symboldict_iter_match_first (const struct dictionary *dict, const char *name, symbol_compare_ftype *compare, struct dict_iterator *iterator)
struct symboldict_iter_match_next (const char *name, symbol_compare_ftype *compare, struct dict_iterator *iterator)
int dict_size (const struct dictionary *dict)
int dict_empty (struct dictionary *dict)

Variables

static struct dict_vector dict_hashed_vector
static struct dict_vector dict_hashed_expandable_vector
static struct dict_vector dict_linear_vector
static struct dict_vector dict_linear_expandable_vector

Define Documentation

Definition at line 203 of file dictionary.c.

Referenced by dict_create_hashed_expandable(), and dict_create_linear_expandable().

#define DICT_HASHED_BUCKET (   d,
 
)    DICT_HASHED_BUCKETS (d) [i]

Definition at line 188 of file dictionary.c.

Referenced by iter_match_first_hashed(), and iterator_hashed_advance().

#define DICT_HASHED_BUCKETS (   d)    (d)->data.hashed.buckets
#define DICT_HASHED_EXPANDABLE_NSYMS (   d)    (d)->data.hashed_expandable.nsyms
#define DICT_HASHED_NBUCKETS (   d)    (d)->data.hashed.nbuckets
#define DICT_HASHTABLE_SIZE (   n)    ((n)/5 + 1)

Definition at line 208 of file dictionary.c.

Referenced by add_symbol_hashed_expandable(), and dict_create_hashed().

#define DICT_ITERATOR_CURRENT (   iter)    (iter)->current
#define DICT_ITERATOR_DICT (   iter)    (iter)->dict
#define DICT_ITERATOR_INDEX (   iter)    (iter)->index
#define DICT_LINEAR_EXPANDABLE_CAPACITY (   d)    (d)->data.linear_expandable.capacity

Definition at line 198 of file dictionary.c.

Referenced by add_symbol_linear_expandable(), and dict_create_linear_expandable().

#define DICT_LINEAR_NSYMS (   d)    (d)->data.linear.nsyms
#define DICT_LINEAR_SYM (   d,
 
)    DICT_LINEAR_SYMS (d) [i]
#define DICT_LINEAR_SYMS (   d)    (d)->data.linear.syms
#define DICT_VECTOR (   d)    (d)->vector

Enumeration Type Documentation

enum dict_type
Enumerator:
DICT_HASHED 
DICT_HASHED_EXPANDABLE 
DICT_LINEAR 
DICT_LINEAR_EXPANDABLE 

Definition at line 90 of file dictionary.c.


Function Documentation

static void add_symbol_hashed_expandable ( struct dictionary dict,
struct symbol sym 
) [static]
static void add_symbol_linear_expandable ( struct dictionary dict,
struct symbol sym 
) [static]
static void add_symbol_nonexpandable ( struct dictionary dict,
struct symbol sym 
) [static]

Definition at line 600 of file dictionary.c.

References _, and internal_error().

void dict_add_pending ( struct dictionary dict,
const struct pending symbol_list 
)
void dict_add_symbol ( struct dictionary dict,
struct symbol sym 
)

Definition at line 496 of file dictionary.c.

References add_symbol(), and DICT_VECTOR.

Referenced by add_class_symtab_symbol(), add_symbol(), and dict_add_pending().

struct dictionary* dict_create_hashed ( struct obstack *  obstack,
const struct pending symbol_list 
) [read]
struct dictionary* dict_create_hashed_expandable ( void  ) [read]
struct dictionary* dict_create_linear ( struct obstack *  obstack,
const struct pending symbol_list 
) [read]
struct dictionary* dict_create_linear_expandable ( void  ) [read]
int dict_empty ( struct dictionary dict)

Definition at line 581 of file dictionary.c.

References dict_iterator_first().

void dict_free ( struct dictionary dict)

Definition at line 488 of file dictionary.c.

References DICT_VECTOR, and free().

Referenced by jv_per_objfile_free().

static unsigned int dict_hash ( const char *  string) [static]

Definition at line 794 of file dictionary.c.

References hash(), msymbol_hash_iw(), string, and SYMBOL_HASH_NEXT.

Referenced by insert_symbol_hashed(), and iter_match_first_hashed().

struct symbol* dict_iter_match_first ( const struct dictionary dict,
const char *  name,
symbol_compare_ftype compare,
struct dict_iterator iterator 
) [read]

Definition at line 552 of file dictionary.c.

References DICT_VECTOR.

Referenced by block_iter_match_first(), block_iter_match_step(), and dict_iter_name_first().

struct symbol* dict_iter_match_next ( const char *  name,
symbol_compare_ftype compare,
struct dict_iterator iterator 
) [read]

Definition at line 561 of file dictionary.c.

References DICT_ITERATOR_DICT, and DICT_VECTOR.

Referenced by block_iter_match_next(), block_iter_match_step(), and dict_iter_name_next().

struct symbol* dict_iter_name_first ( const struct dictionary dict,
const char *  name,
struct dict_iterator iterator 
) [read]

Definition at line 538 of file dictionary.c.

References dict_iter_match_first(), and strcmp_iw().

Referenced by block_iter_name_first(), and block_iter_name_step().

struct symbol* dict_iter_name_next ( const char *  name,
struct dict_iterator iterator 
) [read]

Definition at line 546 of file dictionary.c.

References dict_iter_match_next(), and strcmp_iw().

Referenced by block_iter_name_next(), and block_iter_name_step().

struct symbol* dict_iterator_first ( const struct dictionary dict,
struct dict_iterator iterator 
) [read]

Definition at line 521 of file dictionary.c.

References DICT_VECTOR.

Referenced by block_iterator_first(), block_iterator_step(), and dict_empty().

struct symbol* dict_iterator_next ( struct dict_iterator iterator) [read]

Definition at line 531 of file dictionary.c.

References DICT_ITERATOR_DICT, and DICT_VECTOR.

Referenced by block_iterator_next(), and block_iterator_step().

int dict_size ( const struct dictionary dict)

Definition at line 569 of file dictionary.c.

References DICT_VECTOR.

Referenced by dump_symtab_1().

static void expand_hashtable ( struct dictionary dict) [static]
static void free_hashed_expandable ( struct dictionary dict) [static]

Definition at line 728 of file dictionary.c.

References DICT_HASHED_BUCKETS, and xfree().

static void free_linear_expandable ( struct dictionary dict) [static]

Definition at line 928 of file dictionary.c.

References DICT_LINEAR_SYMS, and xfree().

static void free_obstack ( struct dictionary dict) [static]

Definition at line 594 of file dictionary.c.

static void insert_symbol_hashed ( struct dictionary dict,
struct symbol sym 
) [static]
static struct symbol * iter_match_first_hashed ( const struct dictionary dict,
const char *  name,
symbol_compare_ftype compare,
struct dict_iterator iterator 
) [static, read]
static struct symbol * iter_match_first_linear ( const struct dictionary dict,
const char *  name,
symbol_compare_ftype compare,
struct dict_iterator iterator 
) [static, read]

Definition at line 886 of file dictionary.c.

References DICT_ITERATOR_DICT, DICT_ITERATOR_INDEX, and iter_match_next_linear().

static struct symbol * iter_match_next_hashed ( const char *  name,
symbol_compare_ftype compare,
struct dict_iterator iterator 
) [static, read]

Definition at line 686 of file dictionary.c.

References DICT_ITERATOR_CURRENT, symbol::hash_next, and SYMBOL_SEARCH_NAME.

static struct symbol * iter_match_next_linear ( const char *  name,
symbol_compare_ftype compare,
struct dict_iterator iterator 
) [static, read]
static struct symbol * iterator_first_hashed ( const struct dictionary dict,
struct dict_iterator iterator 
) [static, read]

Definition at line 609 of file dictionary.c.

References DICT_ITERATOR_DICT, DICT_ITERATOR_INDEX, and iterator_hashed_advance().

static struct symbol * iterator_first_linear ( const struct dictionary dict,
struct dict_iterator iterator 
) [static, read]
static struct symbol * iterator_hashed_advance ( struct dict_iterator iter) [static, read]
static struct symbol * iterator_next_hashed ( struct dict_iterator iterator) [static, read]

Definition at line 618 of file dictionary.c.

References DICT_ITERATOR_CURRENT, and iterator_hashed_advance().

static struct symbol * iterator_next_linear ( struct dict_iterator iterator) [static, read]
static int size_hashed ( const struct dictionary dict) [static]

Definition at line 720 of file dictionary.c.

References DICT_HASHED_NBUCKETS.

static int size_hashed_expandable ( const struct dictionary dict) [static]

Definition at line 748 of file dictionary.c.

References DICT_HASHED_EXPANDABLE_NSYMS.

static int size_linear ( const struct dictionary dict) [static]

Definition at line 920 of file dictionary.c.

References DICT_LINEAR_NSYMS.


Variable Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines