#include "completer.h"
#include "value.h"
#include "exec.h"
+#include "observer.h"
#include <fcntl.h>
#include "readline/readline.h"
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);
/* 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;
unpush_target (&exec_ops);
if (from_tty)
- printf_unfiltered ("No executable file now.\n");
+ printf_unfiltered (_("No executable file now.\n"));
}
/* Process the first arg in ARGS as the new exec file.
if (!filename)
{
if (from_tty)
- printf_unfiltered ("No executable file now.\n");
+ printf_unfiltered (_("No executable file now.\n"));
}
else
{
(*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.
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);
printf_filtered ("\t`%s', ", bfd_get_filename (abfd));
wrap_here (" ");
- printf_filtered ("file type %s.\n", bfd_get_target (abfd));
+ printf_filtered (_("file type %s.\n"), bfd_get_target (abfd));
if (abfd == exec_bfd)
{
- printf_filtered ("\tEntry point: ");
- print_address_numeric (bfd_get_start_address (abfd), 1, gdb_stdout);
+ printf_filtered (_("\tEntry point: "));
+ deprecated_print_address_numeric (bfd_get_start_address (abfd), 1, gdb_stdout);
printf_filtered ("\n");
}
for (p = t->to_sections; p < t->to_sections_end; p++)
since most output will then be much wider than necessary. It
may make sense to test the size of the file and choose the
format string accordingly. */
+ /* FIXME: i18n: Need to rewrite this sentence. */
if (info_verbose)
printf_filtered (" @ %s",
hex_string_custom (p->the_bfd_section->filepos, 8));
printf_filtered (" is %s", bfd_section_name (p->bfd, p->the_bfd_section));
if (p->bfd != abfd)
- {
- printf_filtered (" in %s", bfd_get_filename (p->bfd));
- }
+ printf_filtered (" in %s", bfd_get_filename (p->bfd));
printf_filtered ("\n");
}
}
{
struct vmap *vp;
- printf_unfiltered ("\tMapping info for file `%s'.\n", vmap->name);
+ printf_unfiltered (_("\tMapping info for file `%s'.\n"), vmap->name);
printf_unfiltered ("\t %*s %*s %*s %*s %8.8s %s\n",
strlen_paddr (), "tstart",
strlen_paddr (), "tend",
breakpoint_init_inferior). */
static int
-ignore (CORE_ADDR addr, char *contents)
+ignore (CORE_ADDR addr, bfd_byte *contents)
{
return 0;
}
if (!dbx_commands)
{
- c = add_cmd ("file", class_files, file_command,
- "Use FILE as program to be debugged.\n\
+ c = add_cmd ("file", class_files, file_command, _("\
+Use FILE as program to be debugged.\n\
It is read for its symbols, for getting the contents of pure memory,\n\
and it is the program executed when you use the `run' command.\n\
If FILE cannot be found as specified, your execution directory path\n\
($PATH) is searched for a command of that name.\n\
-No arg means to have no executable file and no symbols.", &cmdlist);
+No arg means to have no executable file and no symbols."), &cmdlist);
set_cmd_completer (c, filename_completer);
}
- c = add_cmd ("exec-file", class_files, exec_file_command,
- "Use FILE as program for getting contents of pure memory.\n\
+ c = add_cmd ("exec-file", class_files, exec_file_command, _("\
+Use FILE as program for getting contents of pure memory.\n\
If FILE cannot be found as specified, your execution directory path\n\
is searched for a command of that name.\n\
-No arg means have no executable file.", &cmdlist);
+No arg means have no executable file."), &cmdlist);
set_cmd_completer (c, filename_completer);
- add_com ("section", class_files, set_section_command,
- "Change the base address of section SECTION of the exec file to ADDR.\n\
+ add_com ("section", class_files, set_section_command, _("\
+Change the base address of section SECTION of the exec file to ADDR.\n\
This can be used if the exec file does not contain section addresses,\n\
(such as in the a.out format), or when the addresses specified in the\n\
file itself are wrong. Each section must be changed separately. The\n\
-``info files'' command lists all the sections and their addresses.");
-
- deprecated_add_show_from_set
- (add_set_cmd ("write", class_support, var_boolean, (char *) &write_files,
- "Set writing into executable and core files.",
- &setlist),
- &showlist);
+``info files'' command lists all the sections and their addresses."));
+
+ add_setshow_boolean_cmd ("write", class_support, &write_files, _("\
+Set writing into executable and core files."), _("\
+Show writing into executable and core files."), NULL,
+ NULL,
+ show_write_files,
+ &setlist, &showlist);
add_target (&exec_ops);
}