+2019-10-02 Tom Tromey <tromey@adacore.com>
+
+ * Makefile.in (COMMON_SFILES): Add common-inferior.c.
+ * gdbsupport/common-inferior.c: New file.
+ * infcmd.c (startup_with_shell): Don't define.
+ * nat/fork-inferior.h (startup_with_shell): Don't declare.
+ * gdbsupport/common-inferior.h (startup_with_shell): Declare.
+ * inferior.h (startup_with_shell): Don't declare.
+
2019-10-02 Christian Biesinger <cbiesinger@google.com>
* gdbsupport/gdb_assert.h: Include errors.h.
gdbsupport/cleanups.c \
gdbsupport/common-debug.c \
gdbsupport/common-exceptions.c \
+ gdbsupport/common-inferior.c \
gdbsupport/common-regcache.c \
gdbsupport/common-utils.c \
gdbsupport/errors.c \
+2019-10-02 Tom Tromey <tromey@adacore.com>
+
+ * Makefile.in (SFILES): Add common-inferior.c.
+ (OBS): Add common-inferior.o.
+ * server.c (startup_with_shell): Don't define.
+
2019-10-02 Andrew Burgess <andrew.burgess@embecosm.com>
* linux-low.c (linux_low_read_btrace): Update for change to
$(srcdir)/gdbsupport/cleanups.c \
$(srcdir)/gdbsupport/common-debug.c \
$(srcdir)/gdbsupport/common-exceptions.c \
+ $(srcdir)/gdbsupport/common-inferior.c \
$(srcdir)/gdbsupport/common-regcache.c \
$(srcdir)/gdbsupport/common-utils.c \
$(srcdir)/gdbsupport/errors.c \
gdbsupport/cleanups.o \
gdbsupport/common-debug.o \
gdbsupport/common-exceptions.o \
+ gdbsupport/common-inferior.o \
gdbsupport/job-control.o \
gdbsupport/common-regcache.o \
gdbsupport/common-utils.o \
static gdb_environ our_environ;
-/* Start the inferior using a shell. */
-
-/* We always try to start the inferior using a shell. */
-
-int startup_with_shell = 1;
-
int server_waiting;
static int extended_protocol;
--- /dev/null
+/* Functions to deal with the inferior being executed on GDB or
+ GDBserver.
+
+ Copyright (C) 2019 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "gdbsupport/common-defs.h"
+#include "gdbsupport/common-inferior.h"
+
+/* See common-inferior.h. */
+
+bool startup_with_shell = true;
the directory. */
extern void set_inferior_cwd (const char *cwd);
+/* Whether to start up the debuggee under a shell.
+
+ If startup-with-shell is set, GDB's "run" will attempt to start up
+ the debuggee under a shell. This also happens when using GDBserver
+ under extended remote mode.
+
+ This is in order for argument-expansion to occur. E.g.,
+
+ (gdb) run *
+
+ The "*" gets expanded by the shell into a list of files.
+
+ While this is a nice feature, it may be handy to bypass the shell
+ in some cases. To disable this feature, do "set startup-with-shell
+ false".
+
+ The catch-exec traps expected during start-up will be one more if
+ the target is started up with a shell. */
+extern bool startup_with_shell;
+
#endif /* COMMON_COMMON_INFERIOR_H */
int stopped_by_random_signal;
-/* See inferior.h. */
-
-bool startup_with_shell = true;
-
\f
/* Accessor routines. */
extern void prepare_execution_command (struct target_ops *target,
int background);
-/* Whether to start up the debuggee under a shell.
-
- If startup-with-shell is set, GDB's "run" will attempt to start up
- the debuggee under a shell.
-
- This is in order for argument-expansion to occur. E.g.,
-
- (gdb) run *
-
- The "*" gets expanded by the shell into a list of files.
-
- While this is a nice feature, it may be handy to bypass the shell
- in some cases. To disable this feature, do "set startup-with-shell
- false".
-
- The catch-exec traps expected during start-up will be one more if
- the target is started up with a shell. */
-extern bool startup_with_shell;
-
/* Nonzero if stopped due to completion of a stack dummy routine. */
extern enum stop_stack_kind stop_stack_dummy;
struct target_waitstatus *mystatus,
ptid_t *myptid);
-/* Whether to start up the debuggee under a shell.
-
- If startup-with-shell is set, GDB's "run" will attempt to start up
- the debuggee under a shell. This also happens when using GDBserver
- under extended remote mode.
-
- This is in order for argument-expansion to occur. E.g.,
-
- (gdb) run *
-
- The "*" gets expanded by the shell into a list of files.
-
- While this is a nice feature, it may be handy to bypass the shell
- in some cases. To disable this feature, do "set startup-with-shell
- false".
-
- The catch-exec traps expected during start-up will be one more if
- the target is started up with a shell. */
-extern bool startup_with_shell;
-
/* Perform any necessary tasks before a fork/vfork takes place. ARGS
is a string containing all the arguments received by the inferior.
This function is mainly used by fork_inferior. */