public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFA/RFC/DOC] Fix the different between behavior of "detach inferior"  "kill inferior" and doc
@ 2010-07-30  8:14 Hui Zhu
  2010-07-30  8:45 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Hui Zhu @ 2010-07-30  8:14 UTC (permalink / raw)
  To: gdb-patches ml; +Cc: Eli Zaretskii

Hi,

The doc said:
@kindex detach inferior @var{infno}
@item detach inferior @var{infno}
Detach from the inferior identified by @value{GDBN} inferior number
@var{infno}, and remove it from the inferior list.

@kindex kill inferior @var{infno}
@item kill inferior @var{infno}
Kill the inferior identified by @value{GDBN} inferior number
@var{infno}, and remove it from the inferior list.

But when I try this command:

(gdb) info inferiors
  Num  Description       Executable
* 2    <null>
  1    process 12089     /home/teawater/gdb/1
(gdb) kill inferior 1
(gdb) info inferiors
  Num  Description       Executable
  2    <null>
* 1    <null>            /home/teawater/gdb/1
(gdb)


Inferior 1 is not removed from list.

And I check the code in inferior.c:
  switch_to_thread (tp->ptid);

  target_kill ();

  bfd_cache_close_all ();
}

Look it doesn't want remove it from inferior list.

So I make a patch to update the doc.

Thanks,
Hui

2010-07-30  Hui Zhu  <teawater@gmail.com>

	* gdb.texinfo (Inferiors and Programs): Update the introduce of
	"detach inferior" and "kill inferior".


---
 doc/gdb.texinfo |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/doc/gdb.texinfo
+++ b/doc/gdb.texinfo
@@ -2481,12 +2481,12 @@ using the @w{@code{kill inferior}} comma
 @kindex detach inferior @var{infno}
 @item detach inferior @var{infno}
 Detach from the inferior identified by @value{GDBN} inferior number
-@var{infno}, and remove it from the inferior list.
+@var{infno}.

 @kindex kill inferior @var{infno}
 @item kill inferior @var{infno}
 Kill the inferior identified by @value{GDBN} inferior number
-@var{infno}, and remove it from the inferior list.
+@var{infno}.
 @end table

 After the successful completion of a command such as @code{detach},

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

* Re: [RFA/RFC/DOC] Fix the different between behavior of "detach inferior" "kill inferior" and doc
  2010-07-30  8:14 [RFA/RFC/DOC] Fix the different between behavior of "detach inferior" "kill inferior" and doc Hui Zhu
@ 2010-07-30  8:45 ` Eli Zaretskii
  2010-07-30  9:02   ` Hui Zhu
  2010-07-30  9:38   ` Pedro Alves
  0 siblings, 2 replies; 6+ messages in thread
From: Eli Zaretskii @ 2010-07-30  8:45 UTC (permalink / raw)
  To: Hui Zhu; +Cc: gdb-patches

> From: Hui Zhu <teawater@gmail.com>
> Date: Fri, 30 Jul 2010 16:13:42 +0800
> Cc: Eli Zaretskii <eliz@gnu.org>
> 
> So I make a patch to update the doc.
> 
> Thanks,
> Hui
> 
> 2010-07-30  Hui Zhu  <teawater@gmail.com>
> 
> 	* gdb.texinfo (Inferiors and Programs): Update the introduce of
> 	"detach inferior" and "kill inferior".
> 
> 
> ---
>  doc/gdb.texinfo |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/doc/gdb.texinfo
> +++ b/doc/gdb.texinfo
> @@ -2481,12 +2481,12 @@ using the @w{@code{kill inferior}} comma
>  @kindex detach inferior @var{infno}
>  @item detach inferior @var{infno}
>  Detach from the inferior identified by @value{GDBN} inferior number
> -@var{infno}, and remove it from the inferior list.
> +@var{infno}.
> 
>  @kindex kill inferior @var{infno}
>  @item kill inferior @var{infno}
>  Kill the inferior identified by @value{GDBN} inferior number
> -@var{infno}, and remove it from the inferior list.
> +@var{infno}.
>  @end table

Assuming that the code behaves as intended (i.e. this isn't a bug), I
suggest the following text instead:

 Kill the inferior identified by @value{GDBN} inferior number
 @var{infno}.  Note that the inferior's entry still stays on the list
 of inferiors shown by @code{info inferiors}, but its Description will
 show @samp{<null>}.

and similarly for "detach".

Thanks.

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

* Re: [RFA/RFC/DOC] Fix the different between behavior of "detach  inferior" "kill inferior" and doc
  2010-07-30  8:45 ` Eli Zaretskii
@ 2010-07-30  9:02   ` Hui Zhu
  2010-07-30  9:57     ` Pedro Alves
  2010-07-30  9:38   ` Pedro Alves
  1 sibling, 1 reply; 6+ messages in thread
From: Hui Zhu @ 2010-07-30  9:02 UTC (permalink / raw)
  To: Eli Zaretskii, Joel Brobecker; +Cc: gdb-patches

On Fri, Jul 30, 2010 at 16:44, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Hui Zhu <teawater@gmail.com>
>> Date: Fri, 30 Jul 2010 16:13:42 +0800
>> Cc: Eli Zaretskii <eliz@gnu.org>
>>
>> So I make a patch to update the doc.
>>
>> Thanks,
>> Hui
>>
>> 2010-07-30  Hui Zhu  <teawater@gmail.com>
>>
>>       * gdb.texinfo (Inferiors and Programs): Update the introduce of
>>       "detach inferior" and "kill inferior".
>>
>>
>> ---
>>  doc/gdb.texinfo |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> --- a/doc/gdb.texinfo
>> +++ b/doc/gdb.texinfo
>> @@ -2481,12 +2481,12 @@ using the @w{@code{kill inferior}} comma
>>  @kindex detach inferior @var{infno}
>>  @item detach inferior @var{infno}
>>  Detach from the inferior identified by @value{GDBN} inferior number
>> -@var{infno}, and remove it from the inferior list.
>> +@var{infno}.
>>
>>  @kindex kill inferior @var{infno}
>>  @item kill inferior @var{infno}
>>  Kill the inferior identified by @value{GDBN} inferior number
>> -@var{infno}, and remove it from the inferior list.
>> +@var{infno}.
>>  @end table
>
> Assuming that the code behaves as intended (i.e. this isn't a bug), I
> suggest the following text instead:
>
>  Kill the inferior identified by @value{GDBN} inferior number
>  @var{infno}.  Note that the inferior's entry still stays on the list
>  of inferiors shown by @code{info inferiors}, but its Description will
>  show @samp{<null>}.
>
> and similarly for "detach".
>
> Thanks.
>

OK.  I made a new version.

Joel, do you think 7.2 need this patch?

Thanks,
Hui

2010-07-30  Hui Zhu  <teawater@gmail.com>

	* gdb.texinfo (Inferiors and Programs): Update the introduce of
	"detach inferior" and "kill inferior".
---
 doc/gdb.texinfo |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/doc/gdb.texinfo
+++ b/doc/gdb.texinfo
@@ -2481,12 +2481,16 @@ using the @w{@code{kill inferior}} comma
 @kindex detach inferior @var{infno}
 @item detach inferior @var{infno}
 Detach from the inferior identified by @value{GDBN} inferior number
-@var{infno}, and remove it from the inferior list.
+@var{infno}.  Note that the inferior's entry still stays on the list
+of inferiors shown by @code{info inferiors}, but its Description will
+show @samp{<null>}.

 @kindex kill inferior @var{infno}
 @item kill inferior @var{infno}
 Kill the inferior identified by @value{GDBN} inferior number
-@var{infno}, and remove it from the inferior list.
+@var{infno}.  Note that the inferior's entry still stays on the list
+of inferiors shown by @code{info inferiors}, but its Description will
+show @samp{<null>}.
 @end table

 After the successful completion of a command such as @code{detach},

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

* Re: [RFA/RFC/DOC] Fix the different between behavior of "detach inferior"   "kill inferior" and doc
  2010-07-30  8:45 ` Eli Zaretskii
  2010-07-30  9:02   ` Hui Zhu
@ 2010-07-30  9:38   ` Pedro Alves
  1 sibling, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2010-07-30  9:38 UTC (permalink / raw)
  To: gdb-patches, Eli Zaretskii; +Cc: Hui Zhu

On Friday 30 July 2010 09:44:27, Eli Zaretskii wrote:
> Assuming that the code behaves as intended

It does.  When the command was added, before the multi-program
support, inferiors would only appear on the inferior list
if they were running.  The commands' docs just didn't get updated.
Thanks both.

-- 
Pedro Alves

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

* Re: [RFA/RFC/DOC] Fix the different between behavior of "detach   inferior" "kill inferior" and doc
  2010-07-30  9:02   ` Hui Zhu
@ 2010-07-30  9:57     ` Pedro Alves
  2010-07-30 14:57       ` Hui Zhu
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2010-07-30  9:57 UTC (permalink / raw)
  To: gdb-patches; +Cc: Hui Zhu, Eli Zaretskii, Joel Brobecker

On Friday 30 July 2010 10:02:06, Hui Zhu wrote:
> Joel, do you think 7.2 need this patch?

It's clearly a no-risk patch, assuming it doesn't break
regenerating the docs, and makes the docs match the
real behavior, so, if you'll willing to apply it, then
please go ahead.

-- 
Pedro Alves

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

* Re: [RFA/RFC/DOC] Fix the different between behavior of "detach  inferior" "kill inferior" and doc
  2010-07-30  9:57     ` Pedro Alves
@ 2010-07-30 14:57       ` Hui Zhu
  0 siblings, 0 replies; 6+ messages in thread
From: Hui Zhu @ 2010-07-30 14:57 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Eli Zaretskii, Joel Brobecker

7.2 and head checked in.

Thanks,
Hui

On Fri, Jul 30, 2010 at 17:57, Pedro Alves <pedro@codesourcery.com> wrote:
> On Friday 30 July 2010 10:02:06, Hui Zhu wrote:
>> Joel, do you think 7.2 need this patch?
>
> It's clearly a no-risk patch, assuming it doesn't break
> regenerating the docs, and makes the docs match the
> real behavior, so, if you'll willing to apply it, then
> please go ahead.
>
> --
> Pedro Alves
>

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

end of thread, other threads:[~2010-07-30 14:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-30  8:14 [RFA/RFC/DOC] Fix the different between behavior of "detach inferior" "kill inferior" and doc Hui Zhu
2010-07-30  8:45 ` Eli Zaretskii
2010-07-30  9:02   ` Hui Zhu
2010-07-30  9:57     ` Pedro Alves
2010-07-30 14:57       ` Hui Zhu
2010-07-30  9:38   ` Pedro Alves

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).