aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2024-11-04 13:27:32 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2024-11-25 22:07:03 -0500
commit020c5193ac86ac753441a3302b0f2bdc10d5c616 (patch)
treee0d9b67acc74a9c4e3da237475c1bee53f826beb /gdb
parentAutomatic date update in version.in (diff)
downloadbinutils-gdb-020c5193ac86ac753441a3302b0f2bdc10d5c616.tar.gz
binutils-gdb-020c5193ac86ac753441a3302b0f2bdc10d5c616.tar.bz2
binutils-gdb-020c5193ac86ac753441a3302b0f2bdc10d5c616.zip
gdb: rename abbrev_cache to abbrev_table_cache
This cache holds `abbrev_table` objects, so I think it's clearer and more consistent to name it `abbrev_table_cache`. Rename it and everything that goes along with it. Change-Id: I43448c0aa538dd2c3ae5efd2f7b3e7b827409d8c Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/Makefile.in2
-rw-r--r--gdb/dwarf2/abbrev-table-cache.c (renamed from gdb/dwarf2/abbrev-cache.c)10
-rw-r--r--gdb/dwarf2/abbrev-table-cache.h (renamed from gdb/dwarf2/abbrev-cache.h)14
-rw-r--r--gdb/dwarf2/cooked-index.h15
-rw-r--r--gdb/dwarf2/read.c12
5 files changed, 26 insertions, 27 deletions
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index ecb323d8f02..82381788992 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1088,7 +1088,7 @@ COMMON_SFILES = \
displaced-stepping.c \
dummy-frame.c \
dwarf2/abbrev.c \
- dwarf2/abbrev-cache.c \
+ dwarf2/abbrev-table-cache.c \
dwarf2/ada-imported.c \
dwarf2/aranges.c \
dwarf2/attribute.c \
diff --git a/gdb/dwarf2/abbrev-cache.c b/gdb/dwarf2/abbrev-table-cache.c
index 7e1ff9ceb15..c29cd09478f 100644
--- a/gdb/dwarf2/abbrev-cache.c
+++ b/gdb/dwarf2/abbrev-table-cache.c
@@ -17,12 +17,12 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "dwarf2/abbrev-cache.h"
+#include "dwarf2/abbrev-table-cache.h"
/* Hash function for an abbrev table. */
hashval_t
-abbrev_cache::hash_table (const void *item)
+abbrev_table_cache::hash_table (const void *item)
{
const struct abbrev_table *table = (const struct abbrev_table *) item;
return to_underlying (table->sect_off);
@@ -31,7 +31,7 @@ abbrev_cache::hash_table (const void *item)
/* Comparison function for abbrev table. */
int
-abbrev_cache::eq_table (const void *lhs, const void *rhs)
+abbrev_table_cache::eq_table (const void *lhs, const void *rhs)
{
const struct abbrev_table *l_table = (const struct abbrev_table *) lhs;
const search_key *key = (const search_key *) rhs;
@@ -39,7 +39,7 @@ abbrev_cache::eq_table (const void *lhs, const void *rhs)
&& l_table->sect_off == key->offset);
}
-abbrev_cache::abbrev_cache ()
+abbrev_table_cache::abbrev_table_cache ()
: m_tables (htab_create_alloc (20, hash_table, eq_table,
htab_delete_entry<abbrev_table>,
xcalloc, xfree))
@@ -47,7 +47,7 @@ abbrev_cache::abbrev_cache ()
}
void
-abbrev_cache::add (abbrev_table_up table)
+abbrev_table_cache::add (abbrev_table_up table)
{
/* We allow this as a convenience to the caller. */
if (table == nullptr)
diff --git a/gdb/dwarf2/abbrev-cache.h b/gdb/dwarf2/abbrev-table-cache.h
index 99d1f93f750..4f9111c51f0 100644
--- a/gdb/dwarf2/abbrev-cache.h
+++ b/gdb/dwarf2/abbrev-table-cache.h
@@ -17,17 +17,17 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#ifndef GDB_DWARF2_ABBREV_CACHE_H
-#define GDB_DWARF2_ABBREV_CACHE_H
+#ifndef GDB_DWARF2_ABBREV_TABLE_CACHE_H
+#define GDB_DWARF2_ABBREV_TABLE_CACHE_H
#include "dwarf2/abbrev.h"
-/* An abbrev cache holds abbrev tables for easier reuse. */
-class abbrev_cache
+/* An abbrev table cache holds abbrev tables for easier reuse. */
+class abbrev_table_cache
{
public:
- abbrev_cache ();
- DISABLE_COPY_AND_ASSIGN (abbrev_cache);
+ abbrev_table_cache ();
+ DISABLE_COPY_AND_ASSIGN (abbrev_table_cache);
/* Find an abbrev table coming from the abbrev section SECTION at
offset OFFSET. Return the table, or nullptr if it has not yet
@@ -62,4 +62,4 @@ private:
htab_up m_tables;
};
-#endif /* GDB_DWARF2_ABBREV_CACHE_H */
+#endif /* GDB_DWARF2_ABBREV_TABLE_CACHE_H */
diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h
index 2807f5c3b4a..4b781529c53 100644
--- a/gdb/dwarf2/cooked-index.h
+++ b/gdb/dwarf2/cooked-index.h
@@ -30,7 +30,7 @@
#include "gdbsupport/iterator-range.h"
#include "dwarf2/mapped-index.h"
#include "dwarf2/read.h"
-#include "dwarf2/abbrev-cache.h"
+#include "dwarf2/abbrev-table-cache.h"
#include "dwarf2/parent-map.h"
#include "gdbsupport/range-chain.h"
#include "complaints.h"
@@ -376,11 +376,9 @@ public:
cooked_index_storage ();
DISABLE_COPY_AND_ASSIGN (cooked_index_storage);
- /* Return the current abbrev cache. */
- abbrev_cache *get_abbrev_cache ()
- {
- return &m_abbrev_cache;
- }
+ /* Return the current abbrev table_cache. */
+ abbrev_table_cache *get_abbrev_table_cache ()
+ { return &m_abbrev_table_cache; }
/* Return the DIE reader corresponding to PER_CU. If no such reader
has been registered, return NULL. */
@@ -436,8 +434,9 @@ private:
/* Equality function for cutu_reader. */
static int eq_cutu_reader (const void *a, const void *b);
- /* The abbrev cache used by this indexer. */
- abbrev_cache m_abbrev_cache;
+ /* The abbrev table cache used by this indexer. */
+ abbrev_table_cache m_abbrev_table_cache;
+
/* A hash table of cutu_reader objects. */
htab_up m_reader_hash;
/* The index shard that is being constructed. */
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 2f421a4c266..017a15f4035 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -89,7 +89,7 @@
#include "gdbsupport/pathstuff.h"
#include "count-one-bits.h"
#include <unordered_set>
-#include "dwarf2/abbrev-cache.h"
+#include "dwarf2/abbrev-table-cache.h"
#include "cooked-index.h"
#include "gdbsupport/thread-pool.h"
#include "run-on-main-thread.h"
@@ -588,7 +588,7 @@ public:
struct abbrev_table *abbrev_table,
dwarf2_cu *existing_cu,
bool skip_partial,
- abbrev_cache *cache = nullptr);
+ abbrev_table_cache *cache = nullptr);
explicit cutu_reader (struct dwarf2_per_cu_data *this_cu,
dwarf2_per_objfile *per_objfile,
@@ -4012,7 +4012,7 @@ cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
struct abbrev_table *abbrev_table,
dwarf2_cu *existing_cu,
bool skip_partial,
- abbrev_cache *cache)
+ abbrev_table_cache *cache)
: die_reader_specs {},
m_this_cu (this_cu)
{
@@ -4431,7 +4431,7 @@ cooked_index_storage::get_reader (dwarf2_per_cu_data *per_cu)
cutu_reader *
cooked_index_storage::preserve (std::unique_ptr<cutu_reader> reader)
{
- m_abbrev_cache.add (reader->release_abbrev_table ());
+ m_abbrev_table_cache.add (reader->release_abbrev_table ());
int index = reader->cu->per_cu->index;
void **slot = htab_find_slot_with_hash (m_reader_hash.get (), &index,
@@ -4609,7 +4609,7 @@ process_psymtab_comp_unit (dwarf2_per_cu_data *this_cu,
if (reader == nullptr)
{
cutu_reader new_reader (this_cu, per_objfile, nullptr, nullptr, false,
- storage->get_abbrev_cache ());
+ storage->get_abbrev_table_cache ());
if (new_reader.comp_unit_die == nullptr || new_reader.dummy_p)
return;
@@ -16243,7 +16243,7 @@ cooked_indexer::ensure_cu_exists (cutu_reader *reader,
if (result == nullptr)
{
cutu_reader new_reader (per_cu, per_objfile, nullptr, nullptr, false,
- m_index_storage->get_abbrev_cache ());
+ m_index_storage->get_abbrev_table_cache ());
if (new_reader.dummy_p || new_reader.comp_unit_die == nullptr
|| !new_reader.comp_unit_die->has_children)