Index: gdb/testsuite/gdb.go/strings.exp |
diff --git a/gdb/testsuite/gdb.base/watch-non-mem.exp b/gdb/testsuite/gdb.go/strings.exp |
similarity index 57% |
copy from gdb/testsuite/gdb.base/watch-non-mem.exp |
copy to gdb/testsuite/gdb.go/strings.exp |
index 59351abfd365fe6ac34c4fb1b85c768807a29bb4..a4885a93543ef8db8a4e095732c31992f3bc90ce 100644 |
--- a/gdb/testsuite/gdb.base/watch-non-mem.exp |
+++ b/gdb/testsuite/gdb.go/strings.exp |
@@ -1,5 +1,7 @@ |
-# Copyright 2010-2012 Free Software Foundation, Inc. |
+# This testcase is part of GDB, the GNU debugger. |
+# Copyright 2012 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 |
# the Free Software Foundation; either version 3 of the License, or |
@@ -13,28 +15,27 @@ |
# You should have received a copy of the GNU General Public License |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
-# |
-# Tests watchpoints that watch expressions that don't involve memory. |
-# |
+load_lib "go.exp" |
+ |
+if { [skip_go_tests] } { continue } |
+ |
+standard_testfile .go |
+ |
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } { |
+ return -1 |
+} |
-set testfile "watch-non-mem" |
-set srcfile ${testfile}.c |
-set binfile ${objdir}/${subdir}/${testfile} |
+set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] |
-if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { |
- untested ${testfile}.exp |
+if { [go_runto_main] < 0 } { |
+ untested $testfile |
return -1 |
} |
-if ![runto_main] then { |
- fail "Can't run to main" |
- return |
+if { [gdb_breakpoint ${srcfile}:${bp_location1}] } { |
+ pass "setting breakpoint 1" |
} |
-gdb_test "watch \$pc" \ |
- "Watchpoint .*: .pc" \ |
- "set write watchpoint on \$pc" |
+gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint" |
-gdb_test "continue" \ |
- "Watchpoint 2: .pc.*Old value = .*New value = .*" \ |
- "watchpoint on \$pc works" |
+gdb_test {print "abc" + "def"} {.* = "abcdef"} |