summaryrefslogtreecommitdiff
path: root/gdb/gdb_bfd.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-18 19:49:33 +0000
committerTom Tromey <tromey@redhat.com>2012-07-18 19:49:33 +0000
commit112d5f62dbf2d223aefbb91b17ed15e22327f256 (patch)
tree756ab4b2cfc20bb3b4c6ca96909e648b11987383 /gdb/gdb_bfd.h
parent769cb3532d1a1a06cd9248370244df5ac8b30df6 (diff)
downloadgdb-112d5f62dbf2d223aefbb91b17ed15e22327f256.tar.gz
* 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.
Diffstat (limited to 'gdb/gdb_bfd.h')
-rw-r--r--gdb/gdb_bfd.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h
index a1d5b030beb..78d303b3a67 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. */