aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-04-14 17:26:11 +0000
committerPedro Alves <palves@redhat.com>2010-04-14 17:26:11 +0000
commit516ba659387ce98c4ff28b88a7f00f5003cac9eb (patch)
treec896f42701f1bd92109ca4e91a8ad59c2077374d /gdb/exec.c
parent048d532d6e774418e2e7b40b645b4c249f636aa4 (diff)
downloadgdb-516ba659387ce98c4ff28b88a7f00f5003cac9eb.zip
gdb-516ba659387ce98c4ff28b88a7f00f5003cac9eb.tar.gz
gdb-516ba659387ce98c4ff28b88a7f00f5003cac9eb.tar.bz2
* objfiles.h (gdb_bfd_close_or_warn): Declare.
* objfiles.c (gdb_bfd_close_or_warn): New. * corelow.c: Include objfiles.h (core_close): Use gdb_bfd_close_or_warn. * elfread.c (build_id_verify): Ditto. * exec.c (exec_close, exec_close_1): Ditto.
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 51b33a5..89511bd 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -101,9 +101,7 @@ exec_close (void)
bfd *abfd = exec_bfd;
char *name = bfd_get_filename (abfd);
- if (!bfd_close (abfd))
- warning (_("cannot close \"%s\": %s"),
- name, bfd_errmsg (bfd_get_error ()));
+ gdb_bfd_close_or_warn (abfd);
xfree (name);
/* Removing target sections may close the exec_ops target.
@@ -141,9 +139,7 @@ exec_close_1 (int quitting)
}
else if (vp->bfd != exec_bfd)
/* FIXME-leak: We should be freeing vp->name too, I think. */
- if (!bfd_close (vp->bfd))
- warning (_("cannot close \"%s\": %s"),
- vp->name, bfd_errmsg (bfd_get_error ()));
+ gdb_bfd_close_or_warn (vp->bfd);
xfree (vp);
}