2005-05-01 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / gdb / exec.c
index e8e5f3be0094fd0b776a1d6b80303eda6f4e3ebf..5b8531775359e77d1fd15b8281758627dd1a66c6 100644 (file)
@@ -32,6 +32,7 @@
 #include "completer.h"
 #include "value.h"
 #include "exec.h"
+#include "observer.h"
 
 #include <fcntl.h>
 #include "readline/readline.h"
@@ -61,7 +62,7 @@ static void set_section_command (char *, int);
 
 static void exec_files_info (struct target_ops *);
 
-static int ignore (CORE_ADDR, char *);
+static int ignore (CORE_ADDR, bfd_byte *);
 
 static void init_exec_ops (void);
 
@@ -78,6 +79,14 @@ bfd *exec_bfd = NULL;
 /* Whether to open exec and core files read-only or read-write.  */
 
 int write_files = 0;
+static void
+show_write_files (struct ui_file *file, int from_tty,
+                 struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("Writing into executable and core files is %s.\n"),
+                   value);
+}
+
 
 struct vmap *vmap;
 
@@ -268,6 +277,7 @@ exec_file_attach (char *filename, int from_tty)
        (*deprecated_exec_file_display_hook) (filename);
     }
   bfd_cache_close_all ();
+  observer_notify_executable_changed (NULL);
 }
 
 /*  Process the first arg in ARGS as the new exec file.
@@ -382,14 +392,14 @@ bfdsec_to_vmap (struct bfd *abfd, struct bfd_section *sect, void *arg3)
   if ((bfd_get_section_flags (abfd, sect) & SEC_LOAD) == 0)
     return;
 
-  if (DEPRECATED_STREQ (bfd_section_name (abfd, sect), ".text"))
+  if (strcmp (bfd_section_name (abfd, sect), ".text") == 0)
     {
       vp->tstart = bfd_section_vma (abfd, sect);
       vp->tend = vp->tstart + bfd_section_size (abfd, sect);
       vp->tvma = bfd_section_vma (abfd, sect);
       vp->toffs = sect->filepos;
     }
-  else if (DEPRECATED_STREQ (bfd_section_name (abfd, sect), ".data"))
+  else if (strcmp (bfd_section_name (abfd, sect), ".data") == 0)
     {
       vp->dstart = bfd_section_vma (abfd, sect);
       vp->dend = vp->dstart + bfd_section_size (abfd, sect);
@@ -666,7 +676,7 @@ set_section_command (char *args, int from_tty)
    breakpoint_init_inferior).  */
 
 static int
-ignore (CORE_ADDR addr, char *contents)
+ignore (CORE_ADDR addr, bfd_byte *contents)
 {
   return 0;
 }
@@ -746,7 +756,7 @@ file itself are wrong.  Each section must be changed separately.  The\n\
 Set writing into executable and core files."), _("\
 Show writing into executable and core files."), NULL,
                           NULL,
-                          NULL, /* FIXME: i18n: */
+                          show_write_files,
                           &setlist, &showlist);
 
   add_target (&exec_ops);
This page took 0.025434 seconds and 4 git commands to generate.