mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 06:17:47 +08:00
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.
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
int second(){
|
||||
fork() ;
|
||||
return 12;
|
||||
}
|
||||
|
||||
|
@ -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."
|
||||
|
@ -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)):
|
||||
|
Reference in New Issue
Block a user