mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-01 20:12:01 +08:00
* 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.
This commit is contained in:
@ -648,8 +648,13 @@ gr_load_image (args, fromtty)
|
||||
abfd = bfd_openr (args, (char *) 0);
|
||||
|
||||
if (!abfd)
|
||||
/* FIXME: should be using bfd_errmsg, not assuming it was
|
||||
bfd_error_system_call. */
|
||||
perror_with_name (args);
|
||||
|
||||
/* 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). */
|
||||
old_cleanups = make_cleanup (bfd_close, abfd);
|
||||
|
||||
QUIT;
|
||||
@ -682,7 +687,9 @@ gr_load_image (args, fromtty)
|
||||
|
||||
free (buffer);
|
||||
write_pc (bfd_get_start_address (abfd));
|
||||
bfd_close (abfd);
|
||||
if (!bfd_close (abfd))
|
||||
warning ("cannot close \"%s\": %s",
|
||||
args, bfd_errmsg (bfd_get_error ()));
|
||||
discard_cleanups (old_cleanups);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user