aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-03-03 14:19:19 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-03-03 14:19:19 +0000
commita06715f8dd489123b4850b9e3560addf38a2c720 (patch)
tree2ad03b1879b1916a6dcfbdd22e1289046f655bdd /gdb/testsuite
parent5808517f9a2a8588228bd760c9e6a3a231f4f292 (diff)
downloadgdb-a06715f8dd489123b4850b9e3560addf38a2c720.zip
gdb-a06715f8dd489123b4850b9e3560addf38a2c720.tar.gz
gdb-a06715f8dd489123b4850b9e3560addf38a2c720.tar.bz2
gdb/testsuite/
Code cleanup. * gdb.cp/mb-templates.exp: New variables executable. Use it for binfile. use clean_restart. Replace gdb_expect by gdb_test_multiple. Replace GDB restart by kill and delete_breakpoints. Replace breakpoint number 1 by $bpnum. Four times.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog8
-rw-r--r--gdb/testsuite/gdb.cp/mb-templates.exp37
2 files changed, 24 insertions, 21 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f2436d3..cc39a9a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2012-03-03 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Code cleanup.
+ * gdb.cp/mb-templates.exp: New variables executable. Use it for
+ binfile. use clean_restart. Replace gdb_expect by gdb_test_multiple.
+ Replace GDB restart by kill and delete_breakpoints. Replace breakpoint
+ number 1 by $bpnum. Four times.
+
2012-03-03 Yao Qi <yao@codesourcery.com>
* gdb.trace/strace.exp: run strace_info_marker in linux native gdb.
diff --git a/gdb/testsuite/gdb.cp/mb-templates.exp b/gdb/testsuite/gdb.cp/mb-templates.exp
index 128f9f7..d386c02 100644
--- a/gdb/testsuite/gdb.cp/mb-templates.exp
+++ b/gdb/testsuite/gdb.cp/mb-templates.exp
@@ -26,7 +26,8 @@ if { [istarget "spu*-*-*"] } {
set testfile "mb-templates"
set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+set executable ${testfile}
+set binfile ${objdir}/${subdir}/${executable}
if [get_compiler_info ${binfile} "c++"] {
return -1
@@ -37,10 +38,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${executable}
set bp_location [gdb_get_line_number "set breakpoint here"]
@@ -52,15 +50,12 @@ gdb_test "break $srcfile:$bp_location if i==1" \
"initial condition: set breakpoint"
gdb_run_cmd
-gdb_expect {
+
+set test "initial condition: run to breakpoint"
+gdb_test_multiple "" $test {
-re "Breakpoint \[0-9\]+,.*foo<int> \\(i=1\\).*$gdb_prompt $" {
- pass "initial condition: run to breakpoint"
- }
- -re "$gdb_prompt $" {
- fail "initial condition: run to breakpoint"
- }
- timeout {
- fail "initial condition: run to breakpoint (timeout)"
+ pass $test
+ break
}
}
@@ -70,16 +65,16 @@ gdb_test "continue" \
# Set breakpoint with multiple locations.
# Separately set the condition.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+
+delete_breakpoints
+gdb_test "kill" "" "kill" \
+ {Kill the program being debugged\? \(y or n\) } "y"
gdb_test "break $srcfile:$bp_location" \
"Breakpoint.*at.*: $srcfile:$bp_location. \\(2 locations\\).*" \
"separate condition: set breakpoint"
-gdb_test_no_output "condition 1 i==1" \
+gdb_test_no_output {condition $bpnum i==1} \
"separate condition: set condition"
gdb_run_cmd
@@ -102,7 +97,7 @@ gdb_test "continue" \
# Try disabling a single location. We also test
# that at least in simple cases, the enable/disable
# state of locations surive "run".
-gdb_test_no_output "disable 1.1" "disabling location: disable"
+gdb_test_no_output {disable $bpnum.1} "disabling location: disable"
gdb_run_cmd
gdb_expect {
@@ -118,10 +113,10 @@ gdb_expect {
}
# Try disabling entire breakpoint
-gdb_test_no_output "enable 1.1" "disabling location: enable"
+gdb_test_no_output {enable $bpnum.1} "disabling location: enable"
-gdb_test_no_output "disable 1" "disable breakpoint: disable"
+gdb_test_no_output {disable $bpnum} "disable breakpoint: disable"
gdb_run_cmd
gdb_expect {