diff options
author | Kevin Pouget <kpouget@sourceware.org> | 2011-10-04 08:04:13 +0000 |
---|---|---|
committer | Kevin Pouget <kpouget@sourceware.org> | 2011-10-04 08:04:13 +0000 |
commit | cb6be26b8b0a1bf6bb4da1eb5841119d73220fd5 (patch) | |
tree | 11b0b25089d45ebd5636ac0e8e34ccf094b25dd2 /gdb/testsuite | |
parent | 54d2bafcf26d239467a921fb1c37f4a5e12cfdba (diff) | |
download | gdb-cb6be26b8b0a1bf6bb4da1eb5841119d73220fd5.zip gdb-cb6be26b8b0a1bf6bb4da1eb5841119d73220fd5.tar.gz gdb-cb6be26b8b0a1bf6bb4da1eb5841119d73220fd5.tar.bz2 |
2011-10-04 Kevin Pouget <kevin.pouget@st.com>
PR python/12691: Add the inferior to Python exited event
* python/py-exitedevent.c (create_exited_event_object): Add inferior
to exited_event.
* python/py-event.h (emit_exited_event): Likewise
* python/-inferior.c (python_inferior_exit): Likewise
2011-10-04 Kevin Pouget <kevin.pouget@st.com>
PR python/12691: Add the inferior to Python exited event
* gdb.python/py-events.exp: Test the inferior attribute of exited
event with a fork.
* gdb.python/py-events.py: Print inferior number on exit.
* gdb.python/py-events.c: Fork the inferior.
2011-10-04 Kevin Pouget <kevin.pouget@st.com>
PR python/12691: Add the inferior to Python exited event
* gdb.texinfo (Events In Python): Describe exited inferior attribute.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-events.c | 1 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-events.exp | 11 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-events.py | 1 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9b5ff14..125316e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-10-04 Kevin Pouget <kevin.pouget@st.com> + + PR python/12691: Add the inferior to Python exited event + * gdb.python/py-events.exp: Test the inferior attribute of exited + event with a fork. + * gdb.python/py-events.py: Print inferior number on exit. + * gdb.python/py-events.c: Fork the inferior. + 2011-10-03 Edjunior Machado <emachado@linux.vnet.ibm.com> * gdb.base/jit.exp: Add testcase name to log message diff --git a/gdb/testsuite/gdb.python/py-events.c b/gdb/testsuite/gdb.python/py-events.c index ceb697e..665ca51 100644 --- a/gdb/testsuite/gdb.python/py-events.c +++ b/gdb/testsuite/gdb.python/py-events.c @@ -17,6 +17,7 @@ */ int second(){ + fork() ; return 12; } diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp index 2d2139d..18419fa 100644 --- a/gdb/testsuite/gdb.python/py-events.exp +++ b/gdb/testsuite/gdb.python/py-events.exp @@ -37,6 +37,8 @@ if ![runto_main ] then { return -1 } +gdb_test_no_output "set detach-on-fork off" "" + gdb_test "Test_Events" "Event testers registered." gdb_breakpoint "first" @@ -54,4 +56,11 @@ all threads stopped" #test exited event. gdb_test "continue" ".*event type: continue.* .*event type: exit.* -.*exit code: 12.*" +.*exit code: 12.* +.*exit inf: 1.*" "Inferior 1 terminated." + +gdb_test "inferior 2" ".*Switching to inferior 2.*" +gdb_test "continue" ".*event type: continue.* +.*event type: exit.* +.*exit code: 12.* +.*exit inf: 2.*" "Inferior 2 terminated." diff --git a/gdb/testsuite/gdb.python/py-events.py b/gdb/testsuite/gdb.python/py-events.py index 10aea4f..6bdd935 100644 --- a/gdb/testsuite/gdb.python/py-events.py +++ b/gdb/testsuite/gdb.python/py-events.py @@ -43,6 +43,7 @@ def exit_handler (event): if (isinstance (event, gdb.ExitedEvent)): print "event type: exit" print "exit code: %d" % (event.exit_code) + print "exit inf: %d" % (event.inferior.num) def continue_handler (event): if (isinstance (event, gdb.ContinueEvent)): |