[PATCH] gdb: restore thread after detaching from an inferior

Aktemur, Tankut Baris tankut.baris.aktemur@intel.com
Wed Oct 28 17:11:29 GMT 2020


On Thursday, October 22, 2020 5:36 PM, Pedro Alves wrote:
> On 10/6/20 5:05 PM, Tankut Baris Aktemur via Gdb-patches wrote:
> > 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)
> 
> This is:
> 
>  https://sourceware.org/bugzilla/show_bug.cgi?id=19318
> 
> So I agree with your patch.  But what about "kill inferior" ?

Thanks for the pointer.  I'll send a v2 of the patch in a few minutes
that also prevents the switch for 'kill inferiors'.

-Baris


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


More information about the Gdb-patches mailing list