summaryrefslogtreecommitdiff
path: root/gdb/symfile.h
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-09-08 21:58:19 +0000
committerJim Blandy <jimb@codesourcery.com>2004-09-08 21:58:19 +0000
commit2328c5e16bc5959a1e8e34a15c344558f0a5965c (patch)
tree750f4da64722063ce05bb17e8bc7150bbd954e78 /gdb/symfile.h
parentb20ceb42bee6a6ab8aa3c35e87cc62f6f6df2558 (diff)
downloadgdb-2328c5e16bc5959a1e8e34a15c344558f0a5965c.tar.gz
Fix bug reported and analyzed by Olivier Crete:
* symfile.c (copy_section_addr_info): New function. (symbol_file_add_with_addrs_or_offsets): Use it to save the original set of address arguments, instead of handwritten code that uses one length to allocate and a different length to initialize. Use make_cleanup_free_section_addr_info. * symfile.h (copy_section_addr_info): New declaration. * utils.c: #include "symfile.h". (do_free_section_addr_info, make_cleanup_free_section_addr_info): New functions. * defs.h (make_cleanup_free_section_addr_info): New declaration. * Makefile.in (utils.o): Update dependencies.
Diffstat (limited to 'gdb/symfile.h')
-rw-r--r--gdb/symfile.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/symfile.h b/gdb/symfile.h
index b76d3baddc8..0fa9c46a34b 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -198,6 +198,11 @@ extern struct objfile *symbol_file_add_from_bfd (bfd *, int,
extern struct section_addr_info *alloc_section_addr_info (size_t
num_sections);
+/* Return a freshly allocated copy of ADDRS. The section names, if
+ any, are also freshly allocated copies of those in ADDRS. */
+extern struct section_addr_info *(copy_section_addr_info
+ (struct section_addr_info *addrs));
+
/* Build (allocate and populate) a section_addr_info struct from an
existing section table. */