aboutsummaryrefslogtreecommitdiff
path: root/gdb/corelow.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-10-15 18:28:35 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-10-15 18:28:35 +0000
commit9de0904cce9f2bd32549eade2917c1d2b7256e14 (patch)
tree4751bae933df4c23dcb7e4ce628244dcb45ef532 /gdb/corelow.c
parente080a68fce6b8e73c9869a6016d726f820dee7fc (diff)
downloadfsf-binutils-gdb-9de0904cce9f2bd32549eade2917c1d2b7256e14.zip
fsf-binutils-gdb-9de0904cce9f2bd32549eade2917c1d2b7256e14.tar.gz
fsf-binutils-gdb-9de0904cce9f2bd32549eade2917c1d2b7256e14.tar.bz2
* symfile.c (reread_symbols): Include bfd_errmsg string in error
message if bfd_close fails. * exec.c (exec_close), solib.c (clear_solib), corelow.c (core_close), objfiles.c (free_objfile), irix5-nat.c (clear_solib), osfsolib.c (clear_solib), remote-utils.c (gr_load_image): Check for errors from bfd_close. * solib.c (look_for_base), remote-utils.c (gr_load_image), remote-udi.c (download), corelow.c (core_open), symfile.c (symfile_bfd_open), symfile.c (generic_load): Add comment regarding error from bfd_close. * remote-udi.c (download), remote-utils.c (gr_load_image): Add comment about bogus handling of errors from bfd_openr. * exec.c (exec_close): Add comment regarding memory leak and dangling reference to vp->name.
Diffstat (limited to 'gdb/corelow.c')
-rw-r--r--gdb/corelow.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 7059358..842e2fe2 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -54,11 +54,15 @@ static void
core_close (quitting)
int quitting;
{
+ char *name;
inferior_pid = 0; /* Avoid confusion from thread stuff */
if (core_bfd) {
- free (bfd_get_filename (core_bfd));
- bfd_close (core_bfd);
+ name = bfd_get_filename (core_bfd);
+ if (!bfd_close (core_bfd))
+ warning ("cannot close \"%s\": %s",
+ bfd_filename, bfd_errmsg (bfd_get_error ()));
+ free (name);
core_bfd = NULL;
#ifdef CLEAR_SOLIB
CLEAR_SOLIB ();
@@ -154,6 +158,9 @@ core_open (filename, from_tty)
if (!bfd_check_format (temp_bfd, bfd_core))
{
/* Do it after the err msg */
+ /* FIXME: should be checking for errors from bfd_close (for one thing,
+ on error it does not free all the storage associated with the
+ bfd). */
make_cleanup (bfd_close, temp_bfd);
error ("\"%s\" is not a core dump: %s", filename, bfd_errmsg(bfd_get_error ()));
}