gdb/doc: document MI -remove-inferior command

Message ID 49a2305e22e03e195dd157421cd97e0aaf9c3d37.1676461926.git.aburgess@redhat.com
State New
Headers
Series gdb/doc: document MI -remove-inferior command |

Commit Message

Andrew Burgess Feb. 15, 2023, 11:52 a.m. UTC
  Back in 2010 the -remove-inferior command was added in commit
a79b8f6ea8c2, unfortunately this command was never added to the
documentation.

This commit addresses that oversight.
---
 gdb/doc/gdb.texinfo | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)


base-commit: 25a0d393c728314e257789b948c3a2c98aca7a70
  

Comments

Eli Zaretskii Feb. 15, 2023, 1:55 p.m. UTC | #1
> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Wed, 15 Feb 2023 11:52:16 +0000
> From: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org>
> 
> Back in 2010 the -remove-inferior command was added in commit
> a79b8f6ea8c2, unfortunately this command was never added to the
> documentation.
> 
> This commit addresses that oversight.
> ---
>  gdb/doc/gdb.texinfo | 34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)

Thanks, this is okay.

Approved-By: Eli Zaretskii <eliz@gnu.org>
  
Pedro Alves Feb. 15, 2023, 3:33 p.m. UTC | #2
Hi!

On 2023-02-15 11:52 a.m., Andrew Burgess via Gdb-patches wrote:
>  
> +@subheading The @code{-remove-inferior} Command
> +@findex -remove-inferior

Sorry for the extra trouble, but please put the @findex before the @subheading, as per:

  https://inbox.sourceware.org/gdb-patches/83zg9hec14.fsf@gnu.org/T/#m9adb943b330c10be31774a0009767b0236cbd1f9

Pedro Alves
  
Andrew Burgess Feb. 16, 2023, 8:44 a.m. UTC | #3
Pedro Alves <pedro@palves.net> writes:

> Hi!
>
> On 2023-02-15 11:52 a.m., Andrew Burgess via Gdb-patches wrote:
>>  
>> +@subheading The @code{-remove-inferior} Command
>> +@findex -remove-inferior
>
> Sorry for the extra trouble, but please put the @findex before the @subheading, as per:
>
>   https://inbox.sourceware.org/gdb-patches/83zg9hec14.fsf@gnu.org/T/#m9adb943b330c10be31774a0009767b0236cbd1f9

Not a problem.  I moved the @findex and pushed this patch.

Thanks,
Andrew
  

Patch

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 0beb45857c3..869c0724863 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -3384,6 +3384,7 @@ 
 
 You can now simply switch focus to inferior 2 and run it.
 
+@anchor{remove_inferiors_cli}
 @kindex remove-inferiors
 @item remove-inferiors @var{infno}@dots{}
 Removes the inferior or inferiors @var{infno}@dots{}.  It is not
@@ -38302,6 +38303,39 @@ 
 ^done,inferior="i3"
 @end smallexample
 
+@subheading The @code{-remove-inferior} Command
+@findex -remove-inferior
+
+@subsubheading Synopsis
+
+@smallexample
+-remove-inferior @var{inferior-id}
+@end smallexample
+
+Removes an inferior (@pxref{Inferiors Connections and Programs}).
+Only inferiors that have exited can be removed.  The @var{inferior-id}
+is the inferior to be removed, and should be the same id string as
+returned by the @samp{-add-inferior} command.
+
+When an inferior is successfully removed a
+@code{=thread-group-removed} notification (@pxref{GDB/MI Async
+Records}) is emitted, the @var{id} field of which contains the
+@var{inferior-id} for the removed inferior.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{remove-inferiors}
+(@pxref{remove_inferiors_cli,,@samp{remove-inferiors}}).
+
+@subsubheading Example
+
+@smallexample
+(@value{GDBP})
+-remove-inferior i3
+=thread-group-removed,id="i3"
+^done
+@end smallexample
+
 @subheading The @code{-interpreter-exec} Command
 @findex -interpreter-exec