diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-10-29 15:33:39 +0100 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-10-29 15:33:39 +0100 |
commit | cfaa8f76928803afda1e1862bcd0ab5f7febd647 (patch) | |
tree | b57f35792d6f47559304da193f7069c6d7622214 /gdb/ChangeLog | |
parent | 00c19b8e7879b5e256e7852bdac667466d7a42c2 (diff) | |
download | gdb-cfaa8f76928803afda1e1862bcd0ab5f7febd647.zip gdb-cfaa8f76928803afda1e1862bcd0ab5f7febd647.tar.gz gdb-cfaa8f76928803afda1e1862bcd0ab5f7febd647.tar.bz2 |
gdb: restore thread after detaching or killing an inferior
The "detach inferiors N" command causes the current inferior to
switch. E.g.:
$ gdb a.out
Reading symbols from a.out...
(gdb) start
...
(gdb) add-inferior
[New inferior 2]
Added inferior 2 on connection 1 (native)
(gdb) inferior 2
[Switching to inferior 2 [<null>] (<noexec>)]
(gdb) info inferiors
Num Description Connection Executable
1 process 18242 1 (native) /path/to/a.out
* 2 <null> 1 (native)
(gdb) detach inferiors 1
Detaching from program: /path/to/a.out, process 18242
[Inferior 1 (process 18242) detached]
(gdb) info inferiors
Num Description Connection Executable
* 1 <null> /path/to/a.out
2 <null> 1 (native)
(gdb)
The same switch happens with the "kill inferiors N" command. Prevent
it by restoring the current thread.
gdb/ChangeLog:
2020-10-29 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
PR gdb/19318
* inferior.c (detach_inferior_command): Restore the current thread.
(kill_inferior_command): Ditto.
gdb/testsuite/ChangeLog:
2020-10-29 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* gdb.base/kill-detach-inferiors-cmd.exp: Check that 'kill
inferiors' and 'detach inferiors' do not change the current
inferior.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9dd5c0b..3cef009 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-10-29 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> + + PR gdb/19318 + * inferior.c (detach_inferior_command): Restore the current thread. + (kill_inferior_command): Ditto. + 2020-10-28 Tom de Vries <tdevries@suse.de> PR symtab/26772 |