2012-02-21 Pedro Alves <palves@redhat.com>

* gdb.threads/watchpoint-fork.exp (test): Use with_test_prefix.
This commit is contained in:
Pedro Alves 2012-02-22 00:07:43 +00:00
parent 78afebb483
commit aed555c941
2 changed files with 97 additions and 105 deletions

View file

@ -1,3 +1,7 @@
2012-02-21 Pedro Alves <palves@redhat.com>
* gdb.threads/watchpoint-fork.exp (test): Use with_test_prefix.
2012-02-21 Pedro Alves <palves@redhat.com>
* gdb.base/return-nodebug.exp (do_test): Use with_test_prefix.

View file

@ -23,20 +23,17 @@ if [is_remote target] {
}
proc test {type symbol} { with_test_prefix "$type" {
global testfile objdir subdir srcdir gdb_prompt pf_prefix
global testfile objdir subdir srcdir gdb_prompt
set srcfile_type ${srcdir}/${subdir}/${testfile}-${type}.c
# no threads
set prefix_test $pf_prefix
append pf_prefix " singlethreaded:"
with_test_prefix "singlethreaded" {
set executable ${testfile}-${type}-st
set srcfile_main ${srcdir}/${subdir}/${testfile}-st.c
if { [gdb_compile "${srcfile_main} ${srcfile_type}" ${objdir}/${subdir}/${executable} executable [list debug additional_flags=-D$symbol]] != "" } {
untested ${testfile}.exp
set pf_prefix $prefix_test
return
}
clean_restart $executable
@ -53,7 +50,6 @@ proc test {type symbol} { with_test_prefix "$type" {
gdb_test "handle SIGUSR1 nostop noprint pass" "No\[ \t\]+No\[ \t\]+Yes.*"
if ![runto_main] {
set pf_prefix $prefix_test
return
}
@ -82,24 +78,20 @@ proc test {type symbol} { with_test_prefix "$type" {
gdb_test "continue" \
"atchpoint \[0-9\]+: var.*Old value = 2.*New value = 3.*mark_exit \\(\\);" "watchpoint after the second fork"
gdb_test "continue" "Continuing\\..*\r\nBreakpoint \[0-9\]+, mark_exit .*" "finish"
}
# threads
if [target_info exists gdb,no_hardware_watchpoints] {
# Watchpoint hits would get detected in unexpected threads.
set pf_prefix $prefix_test
return
}
set pf_prefix $prefix_test
append pf_prefix " multithreaded:"
with_test_prefix "multithreaded" {
set executable ${testfile}-${type}-mt
set srcfile_main ${srcdir}/${subdir}/${testfile}-mt.c
if { [gdb_compile_pthreads "${srcfile_main} ${srcfile_type}" ${objdir}/${subdir}/${executable} executable [list debug "additional_flags=-D$symbol -DTHREAD"]] != "" } {
untested ${testfile}.exp
set pf_prefix $prefix_test
return
}
clean_restart $executable
@ -109,7 +101,6 @@ proc test {type symbol} { with_test_prefix "$type" {
gdb_test "handle SIGUSR1 nostop noprint pass" "No\[ \t\]+No\[ \t\]+Yes.*"
if ![runto_main] {
set pf_prefix $prefix_test
return
}
@ -141,10 +132,7 @@ proc test {type symbol} { with_test_prefix "$type" {
gdb_test "continue" \
"atchpoint \[0-9\]+: var.*Old value = 6.*New value = 7.*after-fork2-B.*" "watchpoint B after the second fork"
gdb_test "continue" "Continuing\\..*\r\nBreakpoint \[0-9\]+, mark_exit .*" "finish"
# cleanup
set pf_prefix $prefix_test
}
}}
test parent FOLLOW_PARENT