* gas/arm/abs12.d: Update expected disassembly.
[deliverable/binutils-gdb.git] / gdb / corefile.c
index e5d5eb6c34effcbcbf0a5188c0014d878014459b..726d9fcc5fabc5b25220ed02cd16de4ccbe8e2b3 100644 (file)
@@ -1,7 +1,7 @@
 /* Core dump and executable file functions above target vector, for GDB.
 
    Copyright (C) 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
-   1999, 2000, 2001, 2003, 2006, 2007 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -160,11 +160,15 @@ 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);
-  mtime = bfd_get_mtime (exec_bfd);
   res = stat (filename, &st);
 
-  if (mtime && mtime != st.st_mtime)
+  if (exec_bfd_mtime && exec_bfd_mtime != st.st_mtime)
     exec_file_attach (filename, 0);
+  else
+    /* If we accessed the file since last opening it, close it now;
+       this stops GDB from holding the executable open after it
+       exits.  */
+    bfd_cache_close_all ();
 #endif
 }
 \f
@@ -214,12 +218,12 @@ memory_error (int status, CORE_ADDR memaddr)
       /* Actually, address between memaddr and memaddr + len
          was out of bounds. */
       fprintf_unfiltered (tmp_stream, "Cannot access memory at address ");
-      deprecated_print_address_numeric (memaddr, 1, tmp_stream);
+      fputs_filtered (paddress (memaddr), tmp_stream);
     }
   else
     {
       fprintf_filtered (tmp_stream, "Error accessing memory address ");
-      deprecated_print_address_numeric (memaddr, 1, tmp_stream);
+      fputs_filtered (paddress (memaddr), tmp_stream);
       fprintf_filtered (tmp_stream, ": %s.",
                       safe_strerror (status));
     }
@@ -452,7 +456,7 @@ No arg means have no core file.  This command has been superseded by the\n\
 
   
   add_setshow_string_noescape_cmd ("gnutarget", class_files,
-                                  &gnutarget_string, _("(\
+                                  &gnutarget_string, _("\
 Set the current BFD target."), _("\
 Show the current BFD target."), _("\
 Use `set gnutarget auto' to specify automatic detection."),
This page took 0.023571 seconds and 4 git commands to generate.