aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-11-11 09:46:44 -0700
committerTom Tromey <tom@tromey.com>2024-01-08 18:40:21 -0700
commita2eb3f887cba11c87b625dbbd058557025e57596 (patch)
tree88a2c18a21f44c157d2e60810cddc0e3f16be19b /gdb
parenta37fbcfec5a2f6ac7ccaf508b445f313a55ab7e0 (diff)
downloadgdb-a2eb3f887cba11c87b625dbbd058557025e57596.zip
gdb-a2eb3f887cba11c87b625dbbd058557025e57596.tar.gz
gdb-a2eb3f887cba11c87b625dbbd058557025e57596.tar.bz2
Add a couple of bfd_cache_close calls
This adds a couple of calls to bfd_cache_close at points where a BFD isn't actively needed by gdb. Normally at these points, all the needed section data is already mapped, so we can simply close the file descriptor. This is harmless at worst, because if this is needed after all, the BFD file descriptor cache will reopen it.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/dwarf2/read.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 7a6bb40..45f79de 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -9173,6 +9173,8 @@ open_and_init_dwo_file (dwarf2_cu *cu, const char *dwo_name,
dwarf_read_debug_printf ("DWO file found: %s", dwo_name);
+ bfd_cache_close (dwo_file->dbfd.get ());
+
return dwo_file.release ();
}
@@ -9465,6 +9467,8 @@ open_and_init_dwp_file (dwarf2_per_objfile *per_objfile)
pulongest (dwp_file->cus ? dwp_file->cus->nr_units : 0),
pulongest (dwp_file->tus ? dwp_file->tus->nr_units : 0));
+ bfd_cache_close (dwp_file->dbfd.get ());
+
return dwp_file;
}