summaryrefslogtreecommitdiff
path: root/gdb/gdb_bfd.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-18 19:57:20 +0000
committerTom Tromey <tromey@redhat.com>2012-07-18 19:57:20 +0000
commit4ee2aab930752a33e71dfd11865fde112bc03003 (patch)
tree1383c6dc1e58a6a8466856ce24988c8308d39e29 /gdb/gdb_bfd.h
parent17642581262f80256311ad4a8707c3aa462e0b2a (diff)
downloadgdb-4ee2aab930752a33e71dfd11865fde112bc03003.tar.gz
* dwarf2read.c: Don't include zlib.h or sys/mman.h.
(pagesize): Remove. (struct dwarf2_section_info) <map_addr, map_len>: Remove. (zlib_decompress_section): Remove. (dwarf2_read_section): Use gdb_bfd_map_section. (munmap_section_buffer): Remove. (free_dwo_file, dwarf2_per_objfile_free): Don't use munmap_section_buffer. * gdb_bfd.c: Include zlib.h, sys/mman.h. (struct gdb_bfd_section_data): New. (free_one_bfd_section): New function. (gdb_bfd_close_or_warn): Use free_one_bfd_section. (get_section_descriptor, zlib_decompress_section) (gdb_bfd_map_section): New functions. * gdb_bfd.h (gdb_bfd_map_section): Declare.
Diffstat (limited to 'gdb/gdb_bfd.h')
-rw-r--r--gdb/gdb_bfd.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h
index 78d303b3a67..1dd82c319de 100644
--- a/gdb/gdb_bfd.h
+++ b/gdb/gdb_bfd.h
@@ -1,6 +1,6 @@
/* Definitions for BFD wrappers used by GDB.
- Copyright (C) 2011
+ Copyright (C) 2011, 2012
Free Software Foundation, Inc.
This file is part of GDB.
@@ -46,4 +46,16 @@ struct bfd *gdb_bfd_ref (struct bfd *abfd);
void gdb_bfd_unref (struct bfd *abfd);
+/* Try to read or map the contents of the section SECT. If
+ successful, the section data is returned and *SIZE is set to the
+ size of the section data; this may not be the same as the size
+ according to bfd_get_section_size if the section was compressed.
+ The returned section data is associated with the BFD and will be
+ destroyed when the BFD is destroyed. There is no other way to free
+ it; for temporary uses of section data, see
+ bfd_malloc_and_get_section. SECT may not have relocations. This
+ function will throw on error. */
+
+const gdb_byte *gdb_bfd_map_section (asection *section, bfd_size_type *size);
+
#endif /* GDB_BFD_H */