+2019-12-16 Tom Tromey <tromey@adacore.com>
+
+ * windows-nat.c (windows_nat_target::attach): Update.
+ * remote.c (extended_remote_target::attach): Update.
+ * procfs.c (procfs_target::attach): Update.
+ * nto-procfs.c (nto_procfs_target::attach): Update.
+ (nto_procfs_target::create_inferior): Update.
+ * inf-ptrace.c (inf_ptrace_target::attach): Update.
+ * gnu-nat.c (gnu_nat_target::attach): Update.
+ (gnu_nat_target::detach): Update.
+ * darwin-nat.c (darwin_nat_target::attach): Update.
+ * corefile.c (get_exec_file): Constify result. Remove extraneous
+ return.
+ * bsd-kvm.c (bsd_kvm_target_open): Update.
+ * gdbsupport/common-inferior.h (get_exec_file): Constify result.
+
2019-12-16 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/common-defs.h: Remove workaround for a gnulib bug
bsd_kvm_target_open (const char *arg, int from_tty)
{
char errbuf[_POSIX2_LINE_MAX];
- char *execfile = NULL;
+ const char *execfile = NULL;
kvm_t *temp_kd;
char *filename = NULL;
/* See gdbsupport/common-inferior.h. */
-char *
+const char *
get_exec_file (int err)
{
if (exec_filename)
error (_("No executable file specified.\n\
Use the \"file\" or \"exec-file\" command."));
- return NULL;
}
\f
if (from_tty)
{
- char *exec_file = get_exec_file (0);
+ const char *exec_file = get_exec_file (0);
if (exec_file)
printf_unfiltered (_("Attaching to program: %s, %s\n"), exec_file,
+2019-12-16 Tom Tromey <tromey@adacore.com>
+
+ * server.c (get_exec_file): Constify result.
+
2019-12-10 Christian Biesinger <cbiesinger@google.com>
* Makefile.in: Add safe-strerror.c to gdbreplay and IPA, and change
/* See gdbsupport/common-inferior.h. */
-char *
+const char *
get_exec_file (int err)
{
if (err && program_path.get () == NULL)
/* Return the name of the executable file as a string.
ERR nonzero means get error if there is none specified;
otherwise return 0 in that case. */
-extern char *get_exec_file (int err);
+extern const char *get_exec_file (int err);
/* Return the inferior's current working directory. If nothing has
been set, then return NULL. */
gnu_nat_target::attach (const char *args, int from_tty)
{
int pid;
- char *exec_file;
struct inf *inf = cur_inf ();
struct inferior *inferior;
if (from_tty)
{
- exec_file = (char *) get_exec_file (0);
+ const char *exec_file = get_exec_file (0);
if (exec_file)
printf_unfiltered ("Attaching to program `%s', pid %d\n",
if (from_tty)
{
- char *exec_file = get_exec_file (0);
+ const char *exec_file = get_exec_file (0);
if (exec_file)
printf_unfiltered ("Detaching from program `%s' pid %d\n",
void
inf_ptrace_target::attach (const char *args, int from_tty)
{
- char *exec_file;
pid_t pid;
struct inferior *inf;
if (from_tty)
{
- exec_file = get_exec_file (0);
+ const char *exec_file = get_exec_file (0);
if (exec_file)
printf_unfiltered (_("Attaching to program: %s, %s\n"), exec_file,
void
nto_procfs_target::attach (const char *args, int from_tty)
{
- char *exec_file;
int pid;
struct inferior *inf;
if (from_tty)
{
- exec_file = (char *) get_exec_file (0);
+ const char *exec_file = get_exec_file (0);
if (exec_file)
printf_unfiltered ("Attaching to program `%s', %s\n", exec_file,
argv = xmalloc ((allargs.size () / (unsigned) 2 + 2) *
sizeof (*argv));
- argv[0] = get_exec_file (1);
+ argv[0] = const_cast<char *> (get_exec_file (1));
if (!argv[0])
{
if (exec_file)
void
procfs_target::attach (const char *args, int from_tty)
{
- char *exec_file;
int pid;
pid = parse_pid_to_attach (args);
if (from_tty)
{
- exec_file = get_exec_file (0);
+ const char *exec_file = get_exec_file (0);
if (exec_file)
printf_filtered (_("Attaching to program `%s', %s\n"),
if (from_tty)
{
- char *exec_file = get_exec_file (0);
+ const char *exec_file = get_exec_file (0);
if (exec_file)
printf_unfiltered (_("Attaching to program: %s, %s\n"), exec_file,
if (from_tty)
{
- char *exec_file = (char *) get_exec_file (0);
+ const char *exec_file = get_exec_file (0);
if (exec_file)
printf_unfiltered ("Attaching to program `%s', %s\n", exec_file,