diff options
author | Pedro Alves <palves@redhat.com> | 2016-01-13 10:56:05 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-01-13 10:56:05 +0000 |
commit | e3940304fe75c91f99e260a89fe8c45ece7e373f (patch) | |
tree | 676ba36c91a97c1c80964bc8ef566d1cc424b4bb /gdb/doc | |
parent | a911d87ad714cbfbbc5c5752cb8b445a7e70196c (diff) | |
download | gdb-e3940304fe75c91f99e260a89fe8c45ece7e373f.zip gdb-e3940304fe75c91f99e260a89fe8c45ece7e373f.tar.gz gdb-e3940304fe75c91f99e260a89fe8c45ece7e373f.tar.bz2 |
Add a new $_inferior convenience variable
Like $_thread, but holds the current inferior number.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* NEWS: Mention $_inferior.
* inferior.c (inferior_id_make_value): New.
(inferior_funcs): New.
(_initialize_inferior): Create $_inferior variable.
gdb/testsuite/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* gdb.base/default.exp: Expect $_inferior as well.
* gdb.multi/base.exp: Test $_inferior.
gdb/doc/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Inferiors and Programs): Document the $_inferior
convenience variable.
(Convenience Vars): Likewise.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b4ea0ee..b51e8df 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2016-01-13 Pedro Alves <palves@redhat.com> + + * gdb.texinfo (Inferiors and Programs): Document the $_inferior + convenience variable. + (Convenience Vars): Likewise. + 2016-01-12 Josh Stone <jistone@redhat.com> Philippe Waroquiers <philippe.waroquiers@skynet.be> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 35065e0..d4452a9 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2658,6 +2658,12 @@ Make inferior number @var{infno} the current inferior. The argument in the first field of the @samp{info inferiors} display. @end table +@vindex $_inferior@r{, convenience variable} +The debugger convenience variable @samp{$_inferior} contains the +number of the current inferior. You may find this useful in writing +breakpoint conditional expressions, command scripts, and so forth. +@xref{Convenience Vars,, Convenience Variables}, for general +information on convenience variables. You can get multiple executables into a debugging session via the @code{add-inferior} and @w{@code{clone-inferior}} commands. On some @@ -10382,6 +10388,10 @@ gdbserver that supports the @code{qGetTIBAddr} request. @xref{General Query Packets}. This variable contains the address of the thread information block. +@item $_inferior +The number of the current inferior. @xref{Inferiors and +Programs, ,Debugging Multiple Inferiors and Programs}. + @end table @node Convenience Funs |