GDB (xrefs)

Classes | Macros | Functions
/tmp/gdb-8.1/gdb/bcache.c File Reference
`#include "defs.h"`
`#include "gdb_obstack.h"`
`#include "bcache.h"`

Go to the source code of this file.

## Classes
struct | bstring
struct | bcache

## Macros
#define | CHAIN_LENGTH_THRESHOLD (5)
#define | BSTRING_SIZE(n) (offsetof (struct bstring, d.data) + (n))

## Functions
unsigned long | hash (const void *addr, int length)
unsigned long | hash_continue (const void *addr, int length, unsigned long h)
static void | expand_hash_table (struct bcache *bcache)
const void * | bcache (const void *addr, int length, struct bcache *cache)
const void * | bcache_full (const void *addr, int length, struct bcache *bcache, int *added)
static int | bcache_compare (const void *addr1, const void *addr2, int length)
struct bcache * | bcache_xmalloc (unsigned long(*hash_function)(const void *, int length), int(*compare_function)(const void *, const void *, int length))
void | bcache_xfree (struct bcache *bcache)
static void | print_percentage (int portion, int total)
void | print_bcache_statistics (struct bcache *c, const char *type)
int | bcache_memory_used (struct bcache *bcache)

## Macro Definition Documentation

## ◆ BSTRING_SIZE

#define BSTRING_SIZE | ( |  | n | ) | (offsetof (struct bstring, d.data) + (n))

Definition at line 200 of file bcache.c.

Referenced by bcache_full().

## ◆ CHAIN_LENGTH_THRESHOLD

#define CHAIN_LENGTH_THRESHOLD (5)

Definition at line 124 of file bcache.c.

Referenced by bcache_full().

## Function Documentation

## ◆ bcache()

const void* bcache | ( | const void * | addr,
|  | int | length,
|  | struct bcache * | cache
| ) |  |

Definition at line 206 of file bcache.c.

References bcache_full(), and bstring::length.

Referenced by macro_bcache(), and psymbol_bcache_init().

## ◆ bcache_compare()

static int bcache_compare | ( | const void * | addr1,
|  | const void * | addr2,
|  | int | length
| ) |  |
| static

Definition at line 293 of file bcache.c.

References bstring::length.

Referenced by bcache_xmalloc().

## ◆ bcache_full()

const void* bcache_full | ( | const void * | addr,
|  | int | length,
|  | struct bcache * | bcache,
|  | int * | added
| ) |  |

Definition at line 218 of file bcache.c.

References BSTRING_SIZE, bcache::bucket, bcache::cache, CHAIN_LENGTH_THRESHOLD, bcache::compare_function, bstring::d, bstring::data, expand_hash_table(), bstring::half_hash, bcache::half_hash_miss_count, bcache::hash_function, bstring::length, bstring::next, bcache::num_buckets, bcache::structure_size, bcache::total_count, bcache::total_size, bcache::unique_count, and bcache::unique_size.

Referenced by bcache(), check_types_worklist(), and psymbol_bcache_full().

## ◆ bcache_memory_used()

int bcache_memory_used | ( | struct bcache * | bcache | ) |

Definition at line 486 of file bcache.c.

References bcache::cache, and bcache::total_count.

Referenced by print_objfile_statistics().

## ◆ bcache_xfree()

void bcache_xfree | ( | struct bcache * | bcache | ) |

Definition at line 328 of file bcache.c.

References bcache::bucket, bcache::cache, bcache::total_count, and xfree().

Referenced by free_objfile_per_bfd_storage(), psymbol_bcache_free(), and types_deeply_equal().

## ◆ bcache_xmalloc()

struct bcache* bcache_xmalloc | ( | unsigned long(*)(const void *, int length) | hash_function,
|  | int(*)(const void *, const void *, int length) | compare_function
| ) |  |

Definition at line 306 of file bcache.c.

References bcache_compare(), bcache::compare_function, hash(), bcache::hash_function, and XCNEW.

Referenced by get_objfile_bfd_data(), psymbol_bcache_init(), and types_deeply_equal().

## ◆ expand_hash_table()

static void expand_hash_table | ( | struct bcache * | bcache | ) |
| static

Definition at line 127 of file bcache.c.

References bcache::bucket, bstring::d, bstring::data, bcache::expand_count, bcache::expand_hash_count, bcache::hash_function, bstring::length, memset(), bstring::next, bcache::num_buckets, bcache::structure_size, bcache::unique_count, xfree(), and xmalloc().

Referenced by bcache_full().

## ◆ hash()

unsigned long hash | ( | const void * | addr,
|  | int | length
| ) |  |

Definition at line 98 of file bcache.c.

References hash_continue(), and bstring::length.

Referenced by add_minsym_to_demangled_hash_table(), add_minsym_to_hash_table(), bcache_xmalloc(), debug_names::build(), cp_search_name_hash(), default_search_name_hash(), dwarf5_djb_hash(), find_slot(), find_slot_in_mapped_hash(), frame_addr_hash(), frscm_hash_frame_smob(), gdb_bfd_open(), gdb_bfd_unref(), hash_address_entry(), hash_dwo_file(), hash_symbol_entry(), hashname(), insert_symbol_error(), insert_symbol_hashed(), iterate_over_minimal_symbols(), lookup_dwo_unit_in_dwp(), lookup_minimal_symbol(), lookup_minimal_symbol_and_objfile(), lookup_minimal_symbol_by_pc_name(), lookup_minimal_symbol_demangled(), lookup_minimal_symbol_mangled(), lookup_minimal_symbol_solib_trampoline(), lookup_minimal_symbol_text(), msymbol_hash(), msymbol_hash_iw(), patch_opaque_types(), scan_file_globals(), and symbol_cache_lookup().

## ◆ hash_continue()

unsigned long hash_continue | ( | const void * | addr,
|  | int | length,
|  | unsigned long | h
| ) |  |

Definition at line 106 of file bcache.c.

References bstring::length.

Referenced by hash(), and psymbol_hash().

## ◆ print_bcache_statistics()

void print_bcache_statistics | ( | struct bcache * | c,
|  | const char * | type
| ) |  |

Definition at line 359 of file bcache.c.

References _, bcache::bucket, compare_positive_ints(), bcache::expand_count, bcache::expand_hash_count, gdb_assert, bcache::half_hash_miss_count, bstring::length, bstring::next, bcache::num_buckets, print_percentage(), printf_filtered(), qsort, bcache::structure_size, bcache::total_count, bcache::total_size, bcache::unique_count, bcache::unique_size, XCNEWVEC, and xfree().

Referenced by print_symbol_bcache_statistics().

## ◆ print_percentage()

static void print_percentage | ( | int | portion,
|  | int | total
| ) |  |
| static

Definition at line 344 of file bcache.c.

References _, and printf_filtered().

Referenced by print_bcache_statistics().