Rename some functions, index -> gdb_index

Since we now have two index formats, DWARF5/debug_names and gdb_index, I
wanted to rename some functions to make it clear that they deal with the
gdb_index format specifically.

gdb/ChangeLog:

	* dwarf2read.c (read_index_from_section): Rename to...
	(read_gdb_index_from_section): ... this, update all callers.
	(dwarf2_read_index): Rename to...
	(dwarf2_read_gdb_index): ... this, update all callers.
This commit is contained in:
Simon Marchi 2018-06-11 21:51:25 -04:00 committed by Simon Marchi
parent 69c67a0b2a
commit 7b23e0874d
2 changed files with 29 additions and 22 deletions

View File

@ -1,3 +1,10 @@
2018-06-11 Simon Marchi <simon.marchi@ericsson.com>
* dwarf2read.c (read_index_from_section): Rename to...
(read_gdb_index_from_section): ... this, update all callers.
(dwarf2_read_index): Rename to...
(dwarf2_read_gdb_index): ... this, update all callers.
2018-06-11 John David Anglin <danglin@gcc.gnu.org> 2018-06-11 John David Anglin <danglin@gcc.gnu.org>
* gdb/hppa-linux-nat.c * gdb/hppa-linux-nat.c

View File

@ -3415,15 +3415,15 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name,
Returns 1 if all went well, 0 otherwise. */ Returns 1 if all went well, 0 otherwise. */
static bool static bool
read_index_from_section (struct objfile *objfile, read_gdb_index_from_section (struct objfile *objfile,
const char *filename, const char *filename,
bool deprecated_ok, bool deprecated_ok,
struct dwarf2_section_info *section, struct dwarf2_section_info *section,
struct mapped_index *map, struct mapped_index *map,
const gdb_byte **cu_list, const gdb_byte **cu_list,
offset_type *cu_list_elements, offset_type *cu_list_elements,
const gdb_byte **types_list, const gdb_byte **types_list,
offset_type *types_list_elements) offset_type *types_list_elements)
{ {
const gdb_byte *addr; const gdb_byte *addr;
offset_type version; offset_type version;
@ -3532,7 +3532,7 @@ to use the section anyway."),
elements of all the CUs and return 1. Otherwise, return 0. */ elements of all the CUs and return 1. Otherwise, return 0. */
static int static int
dwarf2_read_index (struct dwarf2_per_objfile *dwarf2_per_objfile) dwarf2_read_gdb_index (struct dwarf2_per_objfile *dwarf2_per_objfile)
{ {
const gdb_byte *cu_list, *types_list, *dwz_list = NULL; const gdb_byte *cu_list, *types_list, *dwz_list = NULL;
offset_type cu_list_elements, types_list_elements, dwz_list_elements = 0; offset_type cu_list_elements, types_list_elements, dwz_list_elements = 0;
@ -3540,11 +3540,11 @@ dwarf2_read_index (struct dwarf2_per_objfile *dwarf2_per_objfile)
struct objfile *objfile = dwarf2_per_objfile->objfile; struct objfile *objfile = dwarf2_per_objfile->objfile;
std::unique_ptr<struct mapped_index> map (new struct mapped_index); std::unique_ptr<struct mapped_index> map (new struct mapped_index);
if (!read_index_from_section (objfile, objfile_name (objfile), if (!read_gdb_index_from_section (objfile, objfile_name (objfile),
use_deprecated_index_sections, use_deprecated_index_sections,
&dwarf2_per_objfile->gdb_index, map.get (), &dwarf2_per_objfile->gdb_index, map.get (),
&cu_list, &cu_list_elements, &cu_list, &cu_list_elements,
&types_list, &types_list_elements)) &types_list, &types_list_elements))
return 0; return 0;
/* Don't use the index if it's empty. */ /* Don't use the index if it's empty. */
@ -3560,12 +3560,12 @@ dwarf2_read_index (struct dwarf2_per_objfile *dwarf2_per_objfile)
const gdb_byte *dwz_types_ignore; const gdb_byte *dwz_types_ignore;
offset_type dwz_types_elements_ignore; offset_type dwz_types_elements_ignore;
if (!read_index_from_section (objfile, bfd_get_filename (dwz->dwz_bfd), if (!read_gdb_index_from_section (objfile,
1, bfd_get_filename (dwz->dwz_bfd), 1,
&dwz->gdb_index, &dwz_map, &dwz->gdb_index, &dwz_map,
&dwz_list, &dwz_list_elements, &dwz_list, &dwz_list_elements,
&dwz_types_ignore, &dwz_types_ignore,
&dwz_types_elements_ignore)) &dwz_types_elements_ignore))
{ {
warning (_("could not read '.gdb_index' section from %s; skipping"), warning (_("could not read '.gdb_index' section from %s; skipping"),
bfd_get_filename (dwz->dwz_bfd)); bfd_get_filename (dwz->dwz_bfd));
@ -6198,7 +6198,7 @@ dwarf2_initialize_objfile (struct objfile *objfile, dw_index_kind *index_kind)
return true; return true;
} }
if (dwarf2_read_index (dwarf2_per_objfile)) if (dwarf2_read_gdb_index (dwarf2_per_objfile))
{ {
*index_kind = dw_index_kind::GDB_INDEX; *index_kind = dw_index_kind::GDB_INDEX;
return true; return true;