Only use the per-BFD object to write a DWARF index
authorTom Tromey <tromey@adacore.com>
Wed, 13 Apr 2022 17:21:20 +0000 (11:21 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 24 Feb 2023 18:46:53 +0000 (11:46 -0700)
commit542a33e348a58e4a9ede20ce294b90d917e1e60c
tree6ae8c92117c29d0ffb9c13fc99c810d9fe1fa8ab
parent71797f1221a95b2c8822e0137c301d31805d4964
Only use the per-BFD object to write a DWARF index

The DWARF index does not need access to the objfile or per-objfile
objects when writing -- it's entirely based on the objfile-independent
per-BFD data.

This patch implements this idea by changing the entire API to only be
passed the per-BFD object.  This simplifies some lifetime reasoning
for the next patch.

This patch removes some code that ensures that the BFD came from a
file.  It seems to me that checking for the existence of a build-id is
good enough for the index cache.
gdb/dwarf2/index-cache.c
gdb/dwarf2/index-cache.h
gdb/dwarf2/index-write.c
gdb/dwarf2/index-write.h
gdb/dwarf2/read.c