2011-09-15 Kevin Pouget <kevin.pouget@st.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-events.exp
1 # Copyright (C) 2010, 2011 Free Software Foundation, Inc.
2
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.
7 #
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.
12 #
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/>.
15
16 if $tracelevel then {
17 strace $tracelevel
18 }
19
20 load_lib gdb-python.exp
21
22 set testfile "py-events"
23 set srcfile ${testfile}.c
24 set binfile ${objdir}/${subdir}/${testfile}
25 set pyfile ${srcdir}/${subdir}/${testfile}.py
26
27 if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
28 return -1
29 }
30
31 if { [skip_python_tests] } { continue }
32
33 gdb_test_no_output "python execfile ('${pyfile}')" ""
34
35 if ![runto_main ] then {
36 fail "Can't run to main"
37 return -1
38 }
39
40 gdb_test "Test_Events" "Event testers registered."
41
42 gdb_breakpoint "first"
43 gdb_breakpoint "first"
44
45 # Test continue event and breakpoint stop event
46 gdb_test "continue" ".*event type: continue.*
47 .*event type: stop.*
48 .*stop reason: breakpoint.*
49 .*first breakpoint number: 2.*
50 .*breakpoint number: 2.*
51 .*breakpoint number: 3.*
52 all threads stopped"
53
54 #test exited event.
55 gdb_test "continue" ".*event type: continue.*
56 .*event type: exit.*
57 .*exit code: 12.*"
This page took 0.037514 seconds and 5 git commands to generate.