aboutsummaryrefslogtreecommitdiff
path: root/gdb/NEWS
diff options
context:
space:
mode:
authorLancelot SIX <lancelot.six@amd.com>2021-12-06 05:23:42 -0500
committerLancelot SIX <lancelot.six@amd.com>2021-12-29 03:27:38 -0500
commit003aae076207dbf32f98ba846158fc32669ef85f (patch)
tree9d10c1c387f413469d7e8428096bb5e2d5ee8fde /gdb/NEWS
parent39907652260b9adc16958e0cbeefa9bc98e9106a (diff)
downloadgdb-003aae076207dbf32f98ba846158fc32669ef85f.zip
gdb-003aae076207dbf32f98ba846158fc32669ef85f.tar.gz
gdb-003aae076207dbf32f98ba846158fc32669ef85f.tar.bz2
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
Diffstat (limited to 'gdb/NEWS')
-rw-r--r--gdb/NEWS7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/NEWS b/gdb/NEWS
index 1e4afa9..c26e15b 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -72,6 +72,13 @@ maint packet
as escaped hex, e.g. \x?? where '??' is replaces with the value of
the non-printable character.
+clone-inferior
+ The clone-inferior command now ensures that the TTY, CMD and ARGS
+ settings are copied from the original inferior to the new one.
+ All modifications to the environment variables done using the 'set
+ environment' or 'unset environment' commands are also copied to the new
+ inferior.
+
* Python API
** New function gdb.add_history(), which takes a gdb.Value object