This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[committed] darwin: fix typo in machoread.c
- From: Tristan Gingold <gingold at adacore dot com>
- To: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Wed, 18 Nov 2009 15:10:23 +0100
- Subject: [committed] darwin: fix typo in machoread.c
Hi,
a stupid typo makes macho_oso_symfile frees bfd that are in fact used. This patch fixes that.
Tristan.
2009-11-18 Tristan Gingold <gingold@adacore.com>
* machoread.c (macho_oso_symfile): Fix typo. Add comments.
diff -c -r1.6 machoread.c
*** machoread.c 13 Oct 2009 09:42:57 -0000 1.6
--- machoread.c 18 Nov 2009 14:08:36 -0000
***************
*** 429,434 ****
--- 429,435 ----
const char *member_name = member_bfd->filename;
int member_len = strlen (member_name);
+ /* If this member is referenced, add it as a symfile. */
for (ix2 = ix; ix2 < last_ix; ix2++)
{
oso2 = VEC_index (oso_el, vec, ix2);
***************
*** 447,453 ****
prev = member_bfd;
member_bfd = bfd_openr_next_archived_file
(archive_bfd, member_bfd);
! if (ix2 < last_ix)
bfd_close (prev);
}
for (ix2 = ix; ix2 < last_ix; ix2++)
--- 448,456 ----
prev = member_bfd;
member_bfd = bfd_openr_next_archived_file
(archive_bfd, member_bfd);
!
! /* Free previous member if not referenced by an oso. */
! if (ix2 >= last_ix)
bfd_close (prev);
}
for (ix2 = ix; ix2 < last_ix; ix2++)