From 6ec53d052b63163944019f5e17d73fafb9c57c2d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 18 Jul 2012 19:49:33 +0000 Subject: * gdb_bfd.c (struct gdb_bfd_data): New. (gdb_bfd_cache): New global. (struct gdb_bfd_cache_search): New. (hash_bfd, eq_bfd, gdb_bfd_open): New functions. (gdb_bfd_ref, gdb_bfd_unref): Use gdb_bfd_data. * gdb_bfd.h (gdb_bfd_open): Declare. --- gdb/gdb_bfd.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gdb/gdb_bfd.h') diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h index a1d5b03..78d303b 100644 --- a/gdb/gdb_bfd.h +++ b/gdb/gdb_bfd.h @@ -27,6 +27,14 @@ void gdb_bfd_stash_filename (struct bfd *abfd); +/* Open a read-only (FOPEN_RB) BFD given arguments like bfd_fopen. + Returns NULL on error. On success, returns a new reference to the + BFD, which must be freed with gdb_bfd_unref. BFDs returned by this + call are shared among all callers opening the same file. If FD is + not -1, then after this call it is owned by BFD. */ + +struct bfd *gdb_bfd_open (const char *name, const char *target, int fd); + /* Acquire a new reference to ABFD. Returns ABFD for convenience. It is fine for ABFD to be NULL; in this case the function does nothing and returns NULL. */ -- cgit v1.1