Make index reading functions more modular
New in v3:
- Remove changed to dwarf-5 functions.
The read_gdb_index_from_section and read_debug_names_from_section
functions read the index content, as their names state, from sections of
object files. A following patch will make it possible to read index
content from standalone files.
This patch therefore decouples the code that reads the index content
from the code that processes that content. Functions
dwarf2_read_gdb_index and dwarf2_read_debug_names receive callbacks that
are responsible for providing the index contents (for both the main file
and the potential dwz file).
gdb/ChangeLog:
* dwarf2read.c (read_gdb_index_from_section): Rename to...
(read_gdb_index_from_buffer): ... this. Remove section
parameter, add buffer parameter.
(get_gdb_index_contents_ftype,
get_gdb_index_contents_dwz_ftype): New typedefs.
(dwarf2_read_gdb_index): Add callback parameters to get the
index contents.
(get_gdb_index_contents_from_section): New.
(dwarf2_initialize_objfile): Update call to
dwarf2_read_gdb_index.