#include "completer.h"
#include "value.h"
#include "exec.h"
+#include "observer.h"
#include <fcntl.h>
#include "readline/readline.h"
/* 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;
else if (vp->bfd != exec_bfd)
/* FIXME-leak: We should be freeing vp->name too, I think. */
if (!bfd_close (vp->bfd))
- warning ("cannot close \"%s\": %s",
+ warning (_("cannot close \"%s\": %s"),
vp->name, bfd_errmsg (bfd_get_error ()));
/* FIXME: This routine is #if 0'd in symfile.c. What should we
char *name = bfd_get_filename (exec_bfd);
if (!bfd_close (exec_bfd))
- warning ("cannot close \"%s\": %s",
+ warning (_("cannot close \"%s\": %s"),
name, bfd_errmsg (bfd_get_error ()));
xfree (name);
exec_bfd = NULL;
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
{
exec_bfd = bfd_fdopenr (scratch_pathname, gnutarget, scratch_chan);
if (!exec_bfd)
- error ("\"%s\": could not open as an executable file: %s",
+ error (_("\"%s\": could not open as an executable file: %s"),
scratch_pathname, bfd_errmsg (bfd_get_error ()));
/* At this point, scratch_pathname and exec_bfd->name both point to the
/* Make sure to close exec_bfd, or else "run" might try to use
it. */
exec_close (0);
- error ("\"%s\": not in executable format: %s",
+ error (_("\"%s\": not in executable format: %s"),
scratch_pathname, bfd_errmsg (bfd_get_error ()));
}
/* Make sure to close exec_bfd, or else "run" might try to use
it. */
exec_close (0);
- error ("\"%s\": can't find the file sections: %s",
+ error (_("\"%s\": can't find the file sections: %s"),
scratch_pathname, bfd_errmsg (bfd_get_error ()));
}
#endif /* DEPRECATED_IBM6000_TARGET */
/* Make sure to close exec_bfd, or else "run" might try to use
it. */
exec_close (0);
- error ("\"%s\": can't find the file sections: %s",
+ error (_("\"%s\": can't find the file sections: %s"),
scratch_pathname, bfd_errmsg (bfd_get_error ()));
}
(*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 (*argv == NULL)
- error ("No executable file name was specified");
+ error (_("No executable file name was specified"));
filename = tilde_expand (*argv);
make_cleanup (xfree, filename);
*end = *start;
bfd_map_over_sections (some_bfd, add_to_section_table, (char *) end);
if (*end > *start + count)
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
+ internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
/* We could realloc the table, but it probably loses for most files. */
return 0;
}
asection *section = NULL;
if (len <= 0)
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
+ internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
if (overlay_debugging)
{
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",
long offset;
if (args == 0)
- error ("Must specify section name and its virtual address");
+ error (_("Must specify section name and its virtual address"));
/* Parse out section name */
for (secname = args; !isspace (*args); args++);
seclen = sizeof (secprint) - 1;
strncpy (secprint, secname, seclen);
secprint[seclen] = '\0';
- error ("Section %s not found", secprint);
+ error (_("Section %s not found"), secprint);
}
/* If mourn is being called in all the right places, this could be say
exec_ops.to_open = exec_open;
exec_ops.to_close = exec_close;
exec_ops.to_attach = find_default_attach;
- exec_ops.to_xfer_memory = xfer_memory;
+ exec_ops.deprecated_xfer_memory = xfer_memory;
exec_ops.to_files_info = exec_files_info;
exec_ops.to_insert_breakpoint = ignore;
exec_ops.to_remove_breakpoint = ignore;
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.");
+``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);
+ 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);
}
static char *
exec_make_note_section (bfd *obfd, int *note_size)
{
- error ("Can't create a corefile");
+ error (_("Can't create a corefile"));
}