aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/mapped-index.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-11-22 16:43:47 -0700
committerTom Tromey <tom@tromey.com>2022-04-20 09:10:03 -0600
commit6606799fc4aaf812d0986166f57c9849b5d562ed (patch)
tree776b79788312a15518f08b4ce17e62fb88892858 /gdb/dwarf2/mapped-index.h
parent045a7baed2e8039fc734b43f4f35393c76e59e55 (diff)
downloadgdb-6606799fc4aaf812d0986166f57c9849b5d562ed.zip
gdb-6606799fc4aaf812d0986166f57c9849b5d562ed.tar.gz
gdb-6606799fc4aaf812d0986166f57c9849b5d562ed.tar.bz2
Introduce and use dwarf_scanner_base
This introduces dwarf_scanner_base, a base class for all the index readers in the DWARF code. Then, it changes both mapped_index_base and cooked_index_vector to derive from this new base class.
Diffstat (limited to 'gdb/dwarf2/mapped-index.h')
-rw-r--r--gdb/dwarf2/mapped-index.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/gdb/dwarf2/mapped-index.h b/gdb/dwarf2/mapped-index.h
index 9f51a9e..39a9ede 100644
--- a/gdb/dwarf2/mapped-index.h
+++ b/gdb/dwarf2/mapped-index.h
@@ -47,13 +47,25 @@ struct name_component
offset_type idx;
};
+/* Base class of all DWARF scanner types. */
+
+struct dwarf_scanner_base
+{
+ dwarf_scanner_base () = default;
+ virtual ~dwarf_scanner_base () = default;
+ DISABLE_COPY_AND_ASSIGN (dwarf_scanner_base);
+
+ /* Return a quick_symbol_functions instance that refers back to this
+ dwarf_scanner_base. */
+ virtual quick_symbol_functions_up make_quick_functions () const = 0;
+};
+
/* Base class containing bits shared by both .gdb_index and
.debug_name indexes. */
-struct mapped_index_base
+struct mapped_index_base : public dwarf_scanner_base
{
mapped_index_base () = default;
- virtual ~mapped_index_base() = default;
DISABLE_COPY_AND_ASSIGN (mapped_index_base);
/* The name_component table (a sorted vector). See name_component's
@@ -77,10 +89,6 @@ struct mapped_index_base
return false;
}
- /* Return a quick_symbol_functions instance that refers back to this
- mapped_index_base. */
- virtual quick_symbol_functions_up make_quick_functions () const = 0;
-
/* Build the symbol name component sorted vector, if we haven't
yet. */
void build_name_components (dwarf2_per_objfile *per_objfile);