diff options
author | Kevin Pouget <kpouget@sourceware.org> | 2011-09-15 12:42:30 +0000 |
---|---|---|
committer | Kevin Pouget <kpouget@sourceware.org> | 2011-09-15 12:42:30 +0000 |
commit | 2aa483373c8e7abf69bbc074a17bf708a1a5eaff (patch) | |
tree | 17786f6230cb15f662de16a68bb5f731d7e68ce0 /gdb/testsuite | |
parent | 6839b47f2b1cd56c90dc38da7bb612df7e052d90 (diff) | |
download | gdb-2aa483373c8e7abf69bbc074a17bf708a1a5eaff.zip gdb-2aa483373c8e7abf69bbc074a17bf708a1a5eaff.tar.gz gdb-2aa483373c8e7abf69bbc074a17bf708a1a5eaff.tar.bz2 |
2011-09-15 Kevin Pouget <kevin.pouget@st.com>
PR Python/12692 Add gdb.selected_inferior() to Python interface.
* python/py-inferior.c (GdbMethods): New Python method definition.
doc:
PR Python/12692 Add gdb.selected_inferior() to Python interface.
* gdb.texinfo (Inferiors In Python): Describe new
gdb.selected_inferior() function.
testsuite:
PR Python/12692 Add gdb.selected_inferior() to Python interface.
* gdb.python/py-inferior.exp: Add testcase for gdb.selected_inferior().
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-inferior.exp | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c33f55b..1ff1358 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-09-15 Kevin Pouget <kevin.pouget@st.com> + + PR Python/12692 Add gdb.selected_inferior() to Python interface. + * gdb.python/py-inferior.exp: Add testcase for gdb.selected_inferior(). + 2011-04-30 Kevin Pouget <kevin.pouget@st.com> Handle multiple breakpoint hits in Python interface: diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp index b853c79..f8e0c4e 100644 --- a/gdb/testsuite/gdb.python/py-inferior.exp +++ b/gdb/testsuite/gdb.python/py-inferior.exp @@ -206,8 +206,18 @@ gdb_test "python print inf_list\[0\].is_valid()" "True" \ "Check inferior validity" gdb_test "python print inf_list\[1\].is_valid()" "True" \ "Check inferior validity" -gdb_test_no_output "remove-inferiors 2" "remove-inferiors 2" +gdb_test_no_output "remove-inferiors 2" "remove-inferiors 3" gdb_test "python print inf_list\[0\].is_valid()" "False" \ "Check inferior validity" gdb_test "python print inf_list\[1\].is_valid()" "True" \ "Check inferior validity" + +# Test gdb.selected_inferior() +gdb_test "inferior 1" ".*" "Switch to first inferior" +gdb_test "py print gdb.selected_inferior().num" "1" "First inferior selected" + +gdb_test "add-inferior" "Added inferior 3" "Create new inferior" +gdb_test "inferior 3" ".*" "Switch to third inferior" +gdb_test "py print gdb.selected_inferior().num" "3" "Third inferior selected" +gdb_test "inferior 1" ".*" "Switch to first inferior" +gdb_test_no_output "remove-inferiors 3" "Remove second inferior"
\ No newline at end of file |