diff options
Diffstat (limited to 'gdb/dwarf2/index-cache.c')
-rw-r--r-- | gdb/dwarf2/index-cache.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c index 4e1aaa0..cfe8ce9 100644 --- a/gdb/dwarf2/index-cache.c +++ b/gdb/dwarf2/index-cache.c @@ -1,6 +1,6 @@ /* Caching of GDB/DWARF index files. - Copyright (C) 1994-2024 Free Software Foundation, Inc. + Copyright (C) 1994-2025 Free Software Foundation, Inc. This file is part of GDB. @@ -103,15 +103,14 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, const bfd_build_id *build_id = build_id_bfd_get (per_bfd->obfd); if (build_id == nullptr) { - index_cache_debug ("objfile %s has no build id", - bfd_get_filename (per_bfd->obfd)); + index_cache_debug ("objfile %s has no build id", per_bfd->filename ()); m_enabled = false; return; } m_build_id_str = build_id_to_string (build_id); /* Get build id of dwz file, if present. */ - const dwz_file *dwz = dwarf2_get_dwz_file (per_bfd); + const dwz_file *dwz = per_bfd->get_dwz_file (); if (dwz != nullptr) { @@ -149,7 +148,7 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, catch (const gdb_exception_error &except) { index_cache_debug ("couldn't store index cache for objfile %s: %s", - bfd_get_filename (per_bfd->obfd), except.what ()); + per_bfd->filename (), except.what ()); m_enabled = false; } } @@ -169,7 +168,7 @@ index_cache_store_context::store () const try { index_cache_debug ("writing index cache for objfile %s", - bfd_get_filename (m_per_bfd->obfd)); + m_per_bfd->filename ()); /* Write the index itself to the directory, using the build id as the filename. */ @@ -180,7 +179,7 @@ index_cache_store_context::store () const catch (const gdb_exception_error &except) { index_cache_debug ("couldn't store index cache for objfile %s: %s", - bfd_get_filename (m_per_bfd->obfd), except.what ()); + m_per_bfd->filename (), except.what ()); } } @@ -203,7 +202,7 @@ struct index_cache_resource_mmap final : public index_cache_resource gdb::array_view<const gdb_byte> index_cache::lookup_gdb_index (const bfd_build_id *build_id, - std::unique_ptr<index_cache_resource> *resource) + index_cache_resource_up *resource) { if (!enabled ()) return {}; @@ -249,7 +248,7 @@ index_cache::lookup_gdb_index (const bfd_build_id *build_id, gdb::array_view<const gdb_byte> index_cache::lookup_gdb_index (const bfd_build_id *build_id, - std::unique_ptr<index_cache_resource> *resource) + index_cache_resource_up *resource) { return {}; } @@ -343,9 +342,7 @@ show_index_cache_stats_command (const char *arg, int from_tty) indent, global_index_cache.n_misses ()); } -void _initialize_index_cache (); -void -_initialize_index_cache () +INIT_GDB_FILE (index_cache) { /* Set the default index cache directory. */ std::string cache_dir = get_standard_cache_dir (); |