This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
FYI: fix bad cleanup
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 15 Dec 2011 08:32:50 -0700
- Subject: FYI: fix bad cleanup
I'm checking this in on the trunk and the 7.4 branch.
If you read symbol_file_add_with_addrs_or_offsets, the cleanup usage
looks like:
my_cleanups = make_cleanup_bfd_close (abfd);
[...]
discard_cleanups (my_cleanups);
[...]
do_cleanups (my_cleanups);
This is wrong. We haven't been bitten by it because, I think, paths to
this function involve a TRY_CATCH and so my_cleanups is NULL. Still,
it is bad to rely on that.
Tom
2011-12-15 Tom Tromey <tromey@redhat.com>
* symfile.c (symbol_file_add_with_addrs_or_offsets): Remove bad
do_cleanups call.
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.320
diff -u -r1.320 symfile.c
--- symfile.c 1 Nov 2011 14:51:21 -0000 1.320
+++ symfile.c 15 Dec 2011 15:26:21 -0000
@@ -1165,8 +1165,6 @@
time. */
gdb_flush (gdb_stdout);
- do_cleanups (my_cleanups);
-
if (objfile->sf == NULL)
{
observer_notify_new_objfile (objfile);