1 /* Reading code for .gdb_index
3 Copyright (C) 2023-2024 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 #ifndef GDB_DWARF2_READ_GDB_INDEX_H
21 #define GDB_DWARF2_READ_GDB_INDEX_H
23 #include "gdbsupport/function-view.h"
25 struct dwarf2_per_bfd
;
26 struct dwarf2_per_objfile
;
30 /* Callback types for dwarf2_read_gdb_index. */
32 typedef gdb::function_view
33 <gdb::array_view
<const gdb_byte
>(objfile
*, dwarf2_per_bfd
*)>
34 get_gdb_index_contents_ftype
;
35 typedef gdb::function_view
36 <gdb::array_view
<const gdb_byte
>(objfile
*, dwz_file
*)>
37 get_gdb_index_contents_dwz_ftype
;
39 /* Read .gdb_index. If everything went ok, initialize the "quick"
40 elements of all the CUs and return 1. Otherwise, return 0. */
42 int dwarf2_read_gdb_index
43 (dwarf2_per_objfile
*per_objfile
,
44 get_gdb_index_contents_ftype get_gdb_index_contents
,
45 get_gdb_index_contents_dwz_ftype get_gdb_index_contents_dwz
);
47 #endif /* GDB_DWARF2_READ_GDB_INDEX_H */