public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/19318] "kill inferior N" and "detach inferior N" commands shouldn't switch to inferior N
       [not found] <bug-19318-4717@http.sourceware.org/bugzilla/>
@ 2020-10-29 14:36 ` cvs-commit at gcc dot gnu.org
  2022-01-09 23:30 ` tromey at sourceware dot org
  1 sibling, 0 replies; 2+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-29 14:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=19318

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tankut Baris Aktemur
<aktemur@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cfaa8f76928803afda1e1862bcd0ab5f7febd647

commit cfaa8f76928803afda1e1862bcd0ab5f7febd647
Author: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Date:   Thu Oct 29 15:33:39 2020 +0100

    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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/19318] "kill inferior N" and "detach inferior N" commands shouldn't switch to inferior N
       [not found] <bug-19318-4717@http.sourceware.org/bugzilla/>
  2020-10-29 14:36 ` [Bug gdb/19318] "kill inferior N" and "detach inferior N" commands shouldn't switch to inferior N cvs-commit at gcc dot gnu.org
@ 2022-01-09 23:30 ` tromey at sourceware dot org
  1 sibling, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2022-01-09 23:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=19318

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |tromey at sourceware dot org
             Status|NEW                         |RESOLVED

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
It looks to me like this was fixed by the patch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-09 23:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-19318-4717@http.sourceware.org/bugzilla/>
2020-10-29 14:36 ` [Bug gdb/19318] "kill inferior N" and "detach inferior N" commands shouldn't switch to inferior N cvs-commit at gcc dot gnu.org
2022-01-09 23:30 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).