This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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++)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]