binutils-gdb/gdb/doc
Lancelot SIX 003aae0762 gdb: Copy inferior properties in clone-inferior
This commit ensures that the following settings are cloned from one
inferior to the new one when processing the clone-inferior command:
  - inferior-tty
  - environment variables
  - cwd
  - args

Some of those parameters can be passed as command line arguments to GDB
(-args and -tty), so one could expect the clone-inferior to respect
those flags.  The following debugging session illustrates that:

    gdb -nx -quiet -batch \
         -ex "show args" \
         -ex "show inferior-tty" \
         -ex "clone-inferior" \
         -ex "inferior 2" \
         -ex "show args" \
         -ex "show inferior-tty" \
         -tty=/some/tty \
         -args echo foo bar
    Argument list to give program being debugged when it is started is "foo bar".
    Terminal for future runs of program being debugged is "/some/tty".
    [New inferior 2]
    Added inferior 2.
    [Switching to inferior 2 [<null>] (/bin/echo)]
    Argument list to give program being debugged when it is started is "".
    Terminal for future runs of program being debugged is "".

The other properties this commit copies on clone (i.e. CWD and the
environment variables) are included since they are related (in the sense
that they influence the runtime behavior of the program) even if they
cannot be directly set using command line switches.

There is a chance that this patch changes existing user workflow.  I
think that this change is mostly harmless.  If users want to start a new
inferior based on an existing one, they probably already propagate those
settings to the new inferior in some way.

Tested on x86_64-linux.

Change-Id: I3b1f28b662f246228b37bb24c2ea1481567b363d
2021-12-29 03:27:38 -05:00
..
.gitignore
a4rc.sed
agentexpr.texi Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
all-cfg.texi Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
annotate.texinfo Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ChangeLog-1991-2021 gdb: move remaining ChangeLogs to legacy files 2021-07-26 12:20:33 +01:00
doxy-index.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Doxyfile-base.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Doxyfile-gdb-api.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Doxyfile-gdb-xref.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Doxyfile-gdbserver.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
fdl.texi
filter-for-doxygen
filter-params.pl
gdb.texinfo gdb: Copy inferior properties in clone-inferior 2021-12-29 03:27:38 -05:00
gpl.texi
guile.texi Guile: temporary breakpoints 2021-07-28 20:30:24 -04:00
lpsrc.sed
Makefile.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
psrc.sed
python.texi gdb/python: Use tp_init instead of tp_new to setup gdb.Value 2021-12-08 13:38:11 +00:00
refcard.tex Manual updates of copyright year range not covered by gdb/copyright.py 2021-01-01 12:13:21 +04:00
stabs.texinfo Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
stack_frame.eps
stack_frame.pdf
stack_frame.png
stack_frame.svg
stack_frame.txt