* objdump.c (SFILE): Add size field.
[deliverable/binutils-gdb.git] / gdb / corefile.c
index 65ea357db971a376a6697b145f686858fde39b9f..7f66ec129ecd6fcc3a01e33460ff4bacbdf584d7 100644 (file)
@@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdbcore.h"
 #include "dis-asm.h"
 #include "language.h"
+#include "gdb_stat.h"
 
 extern char registers[];
 
@@ -137,7 +138,7 @@ specify_exec_file_hook (hook)
 void
 close_exec_file ()
 {
-#ifdef FIXME
+#if 0 /* FIXME */
   if (exec_bfd)
     bfd_tempclose (exec_bfd);
 #endif
@@ -146,9 +147,27 @@ close_exec_file ()
 void
 reopen_exec_file ()
 {
-#ifdef FIXME
+#if 0 /* FIXME */
   if (exec_bfd)
     bfd_reopen (exec_bfd);
+#else
+  char *filename;
+  int res;
+  struct stat st;
+  long mtime;
+
+  /* Don't do anything if the current target isn't exec. */
+  if (exec_bfd == NULL || strcmp (target_shortname, "exec") != 0)
+    return;
+  /* If the timestamp of the exec file has changed, reopen it. */
+  filename = strdup (bfd_get_filename (exec_bfd));
+  make_cleanup (free, filename);
+  mtime = bfd_get_mtime(exec_bfd);
+  res = stat (filename, &st);
+
+  if (mtime && mtime != st.st_mtime)
+    exec_file_command (filename, 0);
 #endif
 }
 \f
@@ -225,6 +244,19 @@ read_memory (memaddr, myaddr, len)
     memory_error (status, memaddr);
 }
 
+void
+read_memory_section (memaddr, myaddr, len, bfd_section)
+     CORE_ADDR memaddr;
+     char *myaddr;
+     int len;
+     asection *bfd_section;
+{
+  int status;
+  status = target_read_memory_section (memaddr, myaddr, len, bfd_section);
+  if (status != 0)
+    memory_error (status, memaddr);
+}
+
 /* Like target_read_memory, but slightly different parameters.  */
 
 int
@@ -283,12 +315,12 @@ read_memory_integer (memaddr, len)
   return extract_signed_integer (buf, len);
 }
 
-unsigned LONGEST
+ULONGEST
 read_memory_unsigned_integer (memaddr, len)
      CORE_ADDR memaddr;
      int len;
 {
-  char buf[sizeof (unsigned LONGEST)];
+  char buf[sizeof (ULONGEST)];
 
   read_memory (memaddr, buf, len);
   return extract_unsigned_integer (buf, len);
This page took 0.02408 seconds and 4 git commands to generate.