diff options
author | Tom Tromey <tromey@redhat.com> | 2009-01-08 16:32:24 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2009-01-08 16:32:24 +0000 |
commit | 7002b113b9e2afed981d3eb9d4157c98a3a3c447 (patch) | |
tree | a682757bb816c210b36d40a9d5ffb929802e65d0 /gdb/corefile.c | |
parent | 8ee6a98bd6643233f00f0c91693ea6a571d54182 (diff) | |
download | gdb-7002b113b9e2afed981d3eb9d4157c98a3a3c447.tar.gz |
PR breakpoints/9350:
* varobj.c (varobj_invalidate): Unconditionally free
all_rootvarobj.
* symfile.c (syms_from_objfile): Free local_addr when returning
normally.
* exec.c (exec_file_attach): Do cleanups before returning.
(exec_file_command): Likewise.
* corefile.c (reopen_exec_file): Do cleanups before returning.
* breakpoint.c (insert_breakpoint_locations): Do cleanups before
returning.
(do_vec_free): New function.
(update_global_location_list): Make a cleanup for old_locations.
Do cleanups before returning. Remove unused variable 'e'.
(find_condition_and_thread): Free result of parsing the
expression.
(print_it_typical): Do cleanups before returning.
(breakpoint_re_set_one): Always free sals.sals.
Diffstat (limited to 'gdb/corefile.c')
-rw-r--r-- | gdb/corefile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/corefile.c b/gdb/corefile.c index 2566f9f3a9f..57a0cdf4576 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -153,6 +153,7 @@ reopen_exec_file (void) int res; struct stat st; long mtime; + struct cleanup *cleanups; /* Don't do anything if there isn't an exec file. */ if (exec_bfd == NULL) @@ -160,7 +161,7 @@ reopen_exec_file (void) /* If the timestamp of the exec file has changed, reopen it. */ filename = xstrdup (bfd_get_filename (exec_bfd)); - make_cleanup (xfree, filename); + cleanups = make_cleanup (xfree, filename); res = stat (filename, &st); if (exec_bfd_mtime && exec_bfd_mtime != st.st_mtime) @@ -170,6 +171,8 @@ reopen_exec_file (void) this stops GDB from holding the executable open after it exits. */ bfd_cache_close_all (); + + do_cleanups (cleanups); #endif } |