aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdb_bfd.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-07-18 19:57:21 +0000
committerTom Tromey <tromey@redhat.com>2012-07-18 19:57:21 +0000
commit4bf44c1cf1abad13fcda09e20983757f175c6dca (patch)
treecdf42085d3145af5f039d7783b63f6ce4d622a32 /gdb/gdb_bfd.h
parentbb39779773bd297e43c409d2643e787aaeb6c3e1 (diff)
downloadgdb-4bf44c1cf1abad13fcda09e20983757f175c6dca.zip
gdb-4bf44c1cf1abad13fcda09e20983757f175c6dca.tar.gz
gdb-4bf44c1cf1abad13fcda09e20983757f175c6dca.tar.bz2
* 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 78d303b..1dd82c3 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 */