]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.python/py-events.exp
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.python / py-events.exp
index e4203899f5e7ee6c05974de8c403ef35ad055f49..7bd6562066ad6b02954b27b64b5445f554984e8c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2010-2013 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if $tracelevel then {
-    strace $tracelevel
+if [target_info exists use_gdb_stub] {
+    return 0
 }
 
 load_lib gdb-python.exp
 
 set libfile "py-events-shlib"
 set libsrc  $srcdir/$subdir/$libfile.c
-set lib_sl  $objdir/$subdir/$libfile.so
+set lib_sl  [standard_output_file $libfile.so]
 set lib_opts  debug
 
-set testfile "py-events"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 set exec_opts [list debug shlib=$lib_sl]
 set pyfile ${srcdir}/${subdir}/${testfile}.py
 
-if [get_compiler_info ${binfile}] {
+if [get_compiler_info] {
     return -1
 }
 
@@ -45,7 +43,7 @@ clean_restart ${testfile}
 
 if { [skip_python_tests] } { continue }
 
-gdb_test_no_output "python execfile ('${pyfile}')" ""
+gdb_test_no_output "python exec (open ('${pyfile}').read ())" ""
 
 gdb_test "Test_Newobj_Events" "New ObjectFile Event tester registered." "Register new objfile event handler"
 
@@ -69,14 +67,28 @@ gdb_test "continue" ".*event type: continue.*
 .*breakpoint number: 3.*
 all threads stopped"
 
+# Test that when "step N" trips on a breakpoint, we get a stop event
+# with breakpoint stop reason.
+gdb_breakpoint "do_nothing"
+gdb_test "step 3" ".*event type: continue.*
+.*event type: stop.*
+.*stop reason: breakpoint.*
+.*first breakpoint number: 4.*
+.*breakpoint number: 4.*
+all threads stopped"
+
+delete_breakpoints
+
 #test exited event.
 gdb_test "continue" ".*event type: continue.*
 .*event type: exit.*
 .*exit code: 12.*
-.*exit inf: 1.*" "Inferior 1 terminated."
+.*exit inf: 1.*
+dir ok: True.*" "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."
+.*exit inf: 2.*
+dir ok: True.*" "Inferior 2 terminated."