Fix mingw32 failures due to incorrect directory separator in pattern

Some testcases, mostly gdb.reverse ones, assume the presence of a
'/' directory separator before the source file name. This is
incorrect for mingw32 hosts, generating false failures for those
tests.

I attempted to catch most of the occurrences of the pattern
".*/$srcfile" and replaced them with ".*$srcfile". The latter
is used elsewhere in the testsuite. The resulting patch is attached.

I also see other occurrences of the same assumption throughout the
testsuite, but usually they are arguments for function calls and i
seem to recall either the test harness or GDB deals with those
paths properly.

gdb/testsuite:

2014-10-17  Luis Machado  <lgustavo@codesourcery.com>

	* gdb.guile/scm-breakpoint.exp: Do not assume any
	directory separators when matching source file paths.
	* gdb.python/py-breakpoint.exp: Likewise.
	* gdb.reverse/break-precsave.exp: Likewise.
	* gdb.reverse/break-reverse.exp: Likewise.
	* gdb.reverse/consecutive-precsave.exp: Likewise.
	* gdb.reverse/finish-precsave.exp: Likewise.
	* gdb.reverse/finish-reverse-bkpt.exp: Likewise.
	* gdb.reverse/finish-reverse.exp: Likewise.
	* gdb.reverse/i386-precsave.exp: Likewise.
	* gdb.reverse/i387-env-reverse.exp: Likewise.
	* gdb.reverse/i387-stack-reverse.exp: Likewise.
	* gdb.reverse/machinestate-precsave.exp: Likewise.
	* gdb.reverse/machinestate.exp: Likewise.
	* gdb.reverse/sigall-precsave.exp: Likewise.
	* gdb.reverse/solib-precsave.exp: Likewise.
	* gdb.reverse/step-precsave.exp: Likewise.
	* gdb.reverse/until-precsave.exp: Likewise.
	* gdb.reverse/watch-precsave.exp: Likewise.
	* gdb.reverse/watch-reverse.exp: Likewise.
This commit is contained in:
Luis Machado 2014-10-17 11:28:17 -03:00
parent b22089abcb
commit a80db0157c
20 changed files with 148 additions and 125 deletions

View file

@ -133,7 +133,7 @@ proc test_bkpt_deletion { } {
gdb_test "python print (len(del_list))" \
"3" "Number of breakpoints before delete"
gdb_continue_to_breakpoint "Break at multiply." \
".*/$srcfile:$deltst_location.*"
".*$srcfile:$deltst_location.*"
gdb_py_test_silent_cmd "python dp1.delete()" \
"Delete Breakpoint" 0
gdb_test "python print (dp1.number)" \
@ -144,7 +144,7 @@ proc test_bkpt_deletion { } {
gdb_test "python print (len(del_list))" \
"2" "Number of breakpoints after delete"
gdb_continue_to_breakpoint "Break at end." \
".*/$srcfile:$end_location.*"
".*$srcfile:$end_location.*"
}
}
@ -356,7 +356,7 @@ proc test_bkpt_eval_funcs { } {
gdb_py_test_silent_cmd "python never_eval_bp1 = bp_also_eval(\"$end_location\")" \
"Set breakpoint" 0
gdb_continue_to_breakpoint "Break at multiply, i==3" \
".*/$srcfile:$bp_location2.*"
".*$srcfile:$bp_location2.*"
gdb_test "print i" \
"3" "Check inferior value matches python accounting"
gdb_test "python print (eval_bp1.inf_i)" \
@ -395,7 +395,7 @@ proc test_bkpt_eval_funcs { } {
gdb_test "python print (check_eval.count)" "0" \
"Test that evaluate function has not been yet executed (ie count = 0)"
gdb_continue_to_breakpoint "Break at multiply, count==1" \
".*/$srcfile:$bp_location2.*"
".*$srcfile:$bp_location2.*"
gdb_test "python print (check_eval.count)" "1" \
"Test that evaluate function is run when location also has normal bp"
@ -452,7 +452,7 @@ proc test_bkpt_temporary { } {
gdb_test "python print (ibp.temporary)" "True" \
"Check breakpoint temporary status"
gdb_continue_to_breakpoint "Break at multiply." \
".*/$srcfile:$ibp_location.*"
".*$srcfile:$ibp_location.*"
gdb_test "python print (ibp.count)" "1" \
"Check temporary stop callback executed before deletion."
gdb_test "python print (ibp.temporary)" "RuntimeError: Breakpoint 2 is invalid.*" \