aboutsummaryrefslogtreecommitdiff
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
commit6ec53d052b63163944019f5e17d73fafb9c57c2d (patch)
tree8bd0dd4e16b2b192102396f08878837761fd5ae6 /gdb/gdb_bfd.h
parentf9a062ffb59ebed937221b852eab2abbd43111ed (diff)
downloadgdb-6ec53d052b63163944019f5e17d73fafb9c57c2d.zip
gdb-6ec53d052b63163944019f5e17d73fafb9c57c2d.tar.gz
gdb-6ec53d052b63163944019f5e17d73fafb9c57c2d.tar.bz2
* 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 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. */