diff options
author | Lancelot SIX <lancelot.six@amd.com> | 2021-12-06 05:23:42 -0500 |
---|---|---|
committer | Lancelot SIX <lancelot.six@amd.com> | 2021-12-29 03:27:38 -0500 |
commit | 003aae076207dbf32f98ba846158fc32669ef85f (patch) | |
tree | 9d10c1c387f413469d7e8428096bb5e2d5ee8fde /gdb/NEWS | |
parent | 39907652260b9adc16958e0cbeefa9bc98e9106a (diff) | |
download | gdb-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/NEWS | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 |