diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-03-02 11:11:47 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-03-07 19:39:04 +0000 |
commit | 6fd90137e776c1a29f75651af8e7a129337254c7 (patch) | |
tree | cb2fa47236787daaef73d74ce4073399aace6e69 /gdb/doc | |
parent | d43bd54d543742c76fb20a0fe379817ccca4e5f2 (diff) | |
download | gdb-6fd90137e776c1a29f75651af8e7a129337254c7.zip gdb-6fd90137e776c1a29f75651af8e7a129337254c7.tar.gz gdb-6fd90137e776c1a29f75651af8e7a129337254c7.tar.bz2 |
gdb/mi: add --no-connection to MI -add-inferior command
Following on from the previous commit, where the -add-inferior command
now uses the same connection as the current inferior, this commit adds
a --no-connection option to -add-inferior.
This new option matches the existing option of the same name for the
CLI version of add-inferior; the new inferior is created with no
connection.
I've added a new 'connection' field to the MI output of -add-inferior,
which includes the connection number and short name. I haven't
included the longer description field, this is the MI after all. My
expectation would be that if the frontend wanted to display all the
connection details then this would be looked up from 'info
connection' (or the MI equivalent if/when such a command is added).
The existing -add-inferior tests are updated, as are the docs.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/gdb.texinfo | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 063e3a1..132b94c 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -3310,6 +3310,7 @@ remove inferiors from the debugging session use the @w{@code{remove-inferiors}} command. @table @code +@anchor{add_inferior_cli} @kindex add-inferior @item add-inferior [ -copies @var{n} ] [ -exec @var{executable} ] [-no-connection ] Adds @var{n} inferiors to be run using @var{executable} as the @@ -37141,15 +37142,45 @@ popup menu, but is needless clutter on the command line, and @subheading Synopsis @smallexample --add-inferior +-add-inferior [ --no-connection ] @end smallexample Creates a new inferior (@pxref{Inferiors Connections and Programs}). The created inferior is not associated with any executable. Such association may be established with the @samp{-file-exec-and-symbols} command -(@pxref{GDB/MI File Commands}). The command response has a single -field, @samp{inferior}, whose value is the identifier of the -thread group corresponding to the new inferior. +(@pxref{GDB/MI File Commands}). + +By default, the new inferior begins connected to the same target +connection as the current inferior. For example, if the current +inferior was connected to @code{gdbserver} with @code{target remote}, +then the new inferior will be connected to the same @code{gdbserver} +instance. The @samp{--no-connection} option starts the new inferior +with no connection yet. You can then for example use the +@code{-target-select remote} command to connect to some other +@code{gdbserver} instance, use @code{-exec-run} to spawn a local +program, etc. + +The command response always has a field, @var{inferior}, whose value +is the identifier of the thread group corresponding to the new +inferior. + +An additional section field, @var{connection}, is optional. This +field will only exist if the new inferior has a target connection. If +this field exists, then its value will be a tuple containing the +following fields: + +@table @samp +@item number +The number of the connection used for the new inferior. + +@item name +The name of the connection type used for the new inferior. +@end table + +@subheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{add-inferior} +(@pxref{add_inferior_cli,,@samp{add-inferior}}). @subheading Example |