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/testsuite/gdb.multi | |
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/testsuite/gdb.multi')
-rw-r--r-- | gdb/testsuite/gdb.multi/base.exp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.multi/base.exp b/gdb/testsuite/gdb.multi/base.exp index 6f0bc63..1aa907d 100644 --- a/gdb/testsuite/gdb.multi/base.exp +++ b/gdb/testsuite/gdb.multi/base.exp @@ -44,12 +44,16 @@ if { [build_executable ${testfile}.exp ${exec3} "${srcfile3}" {debug}] == -1 } { clean_restart ${exec1} +gdb_test {print $_inferior} " = 1" + # Add an empty inferior, switch to it, and load a main executable into # it. gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2" gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2" gdb_test "file ${binfile2}" ".*" "load ${exec2} file in inferior 2" +gdb_test {print $_inferior} " = 2" "print \$_inferior after switching" + # Add a new inferior and load a main executable into it in one # command. gdb_test "add-inferior -exec ${binfile3}" \ |