GDB (xrefs)
|
#include "defs.h"
#include "dwarf2/index-write.h"
#include "addrmap.h"
#include "cli/cli-decode.h"
#include "gdbsupport/byte-vector.h"
#include "gdbsupport/filestuff.h"
#include "gdbsupport/gdb_unlinker.h"
#include "gdbsupport/pathstuff.h"
#include "gdbsupport/scoped_fd.h"
#include "complaints.h"
#include "dwarf2/index-common.h"
#include "dwarf2.h"
#include "dwarf2/read.h"
#include "dwarf2/dwz.h"
#include "gdb/gdb-index.h"
#include "gdbcmd.h"
#include "objfiles.h"
#include "ada-lang.h"
#include "dwarf2/tag.h"
#include <algorithm>
#include <cmath>
#include <forward_list>
#include <set>
#include <unordered_map>
#include <unordered_set>
Go to the source code of this file.
Classes | |
class | data_buf |
struct | symtab_index_entry |
struct | mapped_symtab |
class | c_str_view |
class | c_str_view_hasher |
class | vector_hasher< T > |
struct | addrmap_index_data |
class | debug_names |
class | debug_names::debug_str_lookup |
class | debug_names::index_key |
class | debug_names::index_key_hasher |
class | debug_names::symbol_value |
class | debug_names::offset_vec |
class | debug_names::offset_vec_tmpl< OffsetSize > |
class | debug_names::dwarf |
class | debug_names::dwarf_tmpl< OffsetSize > |
struct | index_wip_file |
Macros | |
#define | DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE(cu_index, value) |
#define | DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE(cu_index, value) |
#define | DW2_GDB_INDEX_CU_SET_VALUE(cu_index, value) |
#define | X(n) |
Typedefs | |
using | cu_index_map = std::unordered_map<const dwarf2_per_cu_data *, unsigned int> |
Functions | |
static void | file_write (FILE *file, const void *data, size_t size) |
template<typename Elem , typename Alloc > | |
static void | file_write (FILE *file, const std::vector< Elem, Alloc > &vec) |
static symtab_index_entry & | find_slot (struct mapped_symtab *symtab, const char *name) |
static void | hash_expand (struct mapped_symtab *symtab) |
static void | add_index_entry (struct mapped_symtab *symtab, const char *name, int is_static, gdb_index_symbol_kind kind, offset_type cu_index) |
static void | write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool) |
static void | add_address_entry (data_buf &addr_vec, CORE_ADDR start, CORE_ADDR end, unsigned int cu_index) |
static void | write_address_map (const addrmap *addrmap, data_buf &addr_vec, cu_index_map &cu_index_htab) |
static bool | check_dwarf64_offsets (dwarf2_per_bfd *per_bfd) |
static void | assert_file_size (FILE *file, size_t expected_size) |
static void | write_gdbindex_1 (FILE *out_file, const data_buf &cu_list, const data_buf &types_cu_list, const data_buf &addr_vec, const data_buf &symtab_vec, const data_buf &constant_pool) |
static void | write_cooked_index (cooked_index *table, const cu_index_map &cu_index_htab, struct mapped_symtab *symtab) |
static void | write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table, FILE *out_file, FILE *dwz_out_file) |
static void | write_debug_names (dwarf2_per_bfd *per_bfd, cooked_index *table, FILE *out_file, FILE *out_file_str) |
void | write_dwarf_index (dwarf2_per_bfd *per_bfd, const char *dir, const char *basename, const char *dwz_basename, dw_index_kind index_kind) |
static void | save_gdb_index_command (const char *arg, int from_tty) |
void | _initialize_dwarf_index_write () |
Variables | |
static const gdb_byte | dwarf5_gdb_augmentation [] = { 'G', 'D', 'B', 0 } |
#define DW2_GDB_INDEX_CU_SET_VALUE | ( | cu_index, | |
value ) |
Definition at line 65 of file index-write.c.
Referenced by add_index_entry().
#define DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE | ( | cu_index, | |
value ) |
Definition at line 57 of file index-write.c.
Referenced by add_index_entry().
#define DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE | ( | cu_index, | |
value ) |
Definition at line 50 of file index-write.c.
Referenced by add_index_entry().
#define X | ( | n | ) |
using cu_index_map = std::unordered_map<const dwarf2_per_cu_data *, unsigned int> |
Definition at line 435 of file index-write.c.
void _initialize_dwarf_index_write | ( | ) |
Definition at line 1620 of file index-write.c.
Referenced by initialize_all_files().
|
static |
Definition at line 463 of file index-write.c.
References data_buf::append_offset(), and data_buf::append_uint().
Referenced by addrmap_index_data::operator()(), and write_address_map().
|
static |
Definition at line 253 of file index-write.c.
References symtab_index_entry::cu_indices, DW2_GDB_INDEX_CU_SET_VALUE, DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE, DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE, find_slot(), hash_expand(), name, and symtab_index_entry::name.
Referenced by write_cooked_index().
|
static |
Definition at line 1064 of file index-write.c.
Referenced by write_debug_names(), and write_gdbindex_1().
|
static |
Definition at line 1049 of file index-write.c.
References dwarf2_per_bfd::all_units.
Referenced by write_debug_names().
|
static |
Definition at line 87 of file index-write.c.
References file_write().
|
static |
|
static |
Definition at line 214 of file index-write.c.
References mapped_index_string_hash(), and name.
Referenced by add_index_entry(), and hash_expand().
|
static |
Definition at line 233 of file index-write.c.
References find_slot().
Referenced by add_index_entry().
|
static |
Definition at line 1493 of file index-write.c.
References current_program_space, DEBUG_NAMES, dwarf2_get_dwz_file(), exception_fprintf(), dwz_file::filename(), objfile::flags, GDB_INDEX, gdb_stderr, get_dwarf2_per_objfile(), OBJF_NOT_FILENAME, objfile_name(), program_space::objfiles(), dwarf2_per_objfile::per_bfd, and write_dwarf_index().
|
static |
Definition at line 503 of file index-write.c.
References add_address_entry(), addrmap_index_data::addr_vec, addrmap_index_data::cu_index_htab, addrmap::foreach(), addrmap_index_data::previous_cu_index, addrmap_index_data::previous_cu_start, and addrmap_index_data::previous_valid.
Referenced by write_gdbindex().
|
static |
Definition at line 1135 of file index-write.c.
References ada_encode(), add_index_entry(), cooked_index::all_entries(), IS_LINKAGE, IS_STATIC, IS_TYPE_DECLARATION, language_ada, language_cplus, and name.
Referenced by write_gdbindex().
|
static |
Definition at line 1282 of file index-write.c.
References debug_names::abbrev_table_bytes(), debug_names::add_cu(), dwarf2_per_bfd::all_comp_units, cooked_index::all_entries(), dwarf2_per_bfd::all_type_units, dwarf2_per_bfd::all_units, data_buf::append_array(), data_buf::append_uint(), assert_file_size(), debug_names::bucket_count(), debug_names::build(), debug_names::bytes(), check_dwarf64_offsets(), dwarf5_gdb_augmentation, debug_names::dwarf5_offset_size(), data_buf::file_write(), debug_names::file_write(), debug_names::insert(), dwarf2_per_cu_data::is_debug_types, debug_names::name_count(), dwarf2_per_bfd::obfd, dwarf2_per_cu_data::sect_off, and data_buf::size().
Referenced by write_dwarf_index().
void write_dwarf_index | ( | dwarf2_per_bfd * | per_bfd, |
const char * | dir, | ||
const char * | basename, | ||
const char * | dwz_basename, | ||
dw_index_kind | index_kind ) |
Definition at line 1446 of file index-write.c.
References DEBUG_NAMES, DEBUG_STR_SUFFIX, index_wip_file::finalize(), INDEX4_SUFFIX, INDEX5_SUFFIX, dwarf2_per_bfd::index_table, index_wip_file::out_file, dwarf2_per_bfd::types, write_debug_names(), and write_gdbindex().
Referenced by save_gdb_index_command(), and index_cache::store().
|
static |
Definition at line 1195 of file index-write.c.
References dwarf2_per_bfd::all_units, data_buf::append_uint(), data_buf::empty(), cooked_index::get_addrmaps(), dwarf2_per_cu_data::is_debug_types, dwarf2_per_cu_data::is_dwz, dwarf2_per_cu_data::length(), dwarf2_per_cu_data::sect_off, signatured_type::signature, signatured_type::type_offset_in_tu, write_address_map(), write_cooked_index(), write_gdbindex_1(), and write_hash_table().
Referenced by write_dwarf_index().
|
static |
Definition at line 1076 of file index-write.c.
References data_buf::append_offset(), assert_file_size(), data_buf::file_write(), and data_buf::size().
Referenced by write_gdbindex().
|
static |
Definition at line 370 of file index-write.c.
References data_buf::append_cstr0(), data_buf::append_offset(), and data_buf::size().
Referenced by write_gdbindex().
Definition at line 1275 of file index-write.c.
Referenced by write_debug_names().