1 # Copyright (C) 2010, 2011 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 load_lib gdb-python.exp
22 set testfile "py-events"
23 set srcfile ${testfile}.c
24 set binfile ${objdir}/${subdir}/${testfile}
25 set pyfile ${srcdir}/${subdir}/${testfile}.py
27 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
31 if { [skip_python_tests] } { continue }
33 gdb_test_no_output "python execfile ('${pyfile}')" ""
35 if ![runto_main ] then {
36 fail "Can't run to main"
40 gdb_test_no_output "set detach-on-fork off" ""
42 gdb_test "Test_Events" "Event testers registered."
44 gdb_breakpoint "first"
45 gdb_breakpoint "first"
47 # Test continue event and breakpoint stop event
48 gdb_test "continue" ".*event type: continue.*
50 .*stop reason: breakpoint.*
51 .*first breakpoint number: 2.*
52 .*breakpoint number: 2.*
53 .*breakpoint number: 3.*
57 gdb_test "continue" ".*event type: continue.*
60 .*exit inf: 1.*" "Inferior 1 terminated."
62 gdb_test "inferior 2" ".*Switching to inferior 2.*"
63 gdb_test "continue" ".*event type: continue.*
66 .*exit inf: 2.*" "Inferior 2 terminated."