Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / watchpoint.exp
index c096306e9303b0905894017958666327e9e0b407..d27179de667a3f0a657a20710daf80d9cf6f9949 100644 (file)
@@ -1,18 +1,18 @@
-# Copyright (C) 1992, 1994, 1997, 1998 Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2007, 2008
+# 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 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Please email any bugs, comments, and/or additions to this file to:
 # bug-gdb@prep.ai.mit.edu
@@ -37,7 +37,8 @@ if [get_compiler_info ${binfile}] {
 }
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+     untested watchpoint.exp
+     return -1
 }
 
 # Prepare for watchpoint tests by setting up two breakpoints and one
@@ -373,31 +374,8 @@ proc test_stepping {} {
        gdb_test "break func2 if 0" "Breakpoint.*at.*"
        gdb_test "p \$func2_breakpoint_number = \$bpnum" " = .*"
 
-       # The problem is that GDB confuses stepping through the call
-       # dummy with hitting the breakpoint at the end of the call dummy.
-       # Will be fixed once all architectures define 
-       # CALL_DUMMY_BREAKPOINT_OFFSET.
-       setup_xfail "*-*-*"
-       # This doesn't occur if the call dummy starts with a call,
-       # because we are out of the dummy by the first time the inferior
-       # stops.
-       clear_xfail "arm*-*-*"
-       clear_xfail "d10v*-*-*"
-       clear_xfail "m68*-*-*"
-       clear_xfail "i*86*-*-*"
-       clear_xfail "vax-*-*"
-       # The following architectures define CALL_DUMMY_BREAKPOINT_OFFSET.
-       clear_xfail "alpha-*-*"
-       clear_xfail "mips*-*-*"
-       clear_xfail "sparc-*-*"
-       clear_xfail "hppa*-*-*bsd*"
-       # It works with the generic inferior function calling code too.
-       clear_xfail "mn10200*-*-*"
-       clear_xfail "mn10300*-*-*"
-       # The following architectures define CALL_DUMMY_HAS_COMPLETED.
-       clear_xfail "hppa*-*-*hpux*"
        gdb_test "p func1 ()" "= 73" \
-       "calling function with watchpoint enabled"
+           "calling function with watchpoint enabled"
 
        # 
        # "finish" brings us back to main.
@@ -646,12 +624,34 @@ proc test_complex_watchpoint {} {
     }
 }
 
+proc test_watchpoint_and_breakpoint {} {
+    global gdb_prompt
+
+    # This is a test for PR gdb/38, which involves setting a
+    # watchpoint right after you've reached a breakpoint.
+
+    if [runto func3] then {
+       gdb_breakpoint [gdb_get_line_number "second x assignment"]
+       gdb_continue_to_breakpoint "second x assignment"
+       gdb_test "watch x" ".*atchpoint \[0-9\]+: x"
+       gdb_test_multiple "next" "next after watch x" {
+           -re ".*atchpoint \[0-9\]+: x\r\n\r\nOld value = 0\r\nNew value = 1\r\n.*$gdb_prompt $" {
+               pass "next after watch x"
+           }
+           -re "\[0-9\]+\[\t \]+y = 1;\r\n$gdb_prompt $" {
+               kfail "gdb/38" "next after watch x"
+           }
+       }
+    }
+}
+    
 # Start with a fresh gdb.
 
 gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load $binfile
+set prev_timeout $timeout
 set timeout 600        
 verbose "Timeout now 600 sec.\n"
 
@@ -757,7 +757,7 @@ if [initialize] then {
     }
 
     # We've explicitly disabled hardware watches.  Verify that GDB
-    # 
+    # refrains from using them.
     #
     send_gdb "rwatch ival3\n"
     gdb_expect {
@@ -796,4 +796,19 @@ if [initialize] then {
         timeout {fail "(timeout) access watches disallowed"}
       }
     }
+
+    # See above.
+    if [istarget "mips-idt-*"] then {
+       gdb_exit
+       gdb_start
+       gdb_reinitialize_dir $srcdir/$subdir
+       gdb_load $binfile
+       initialize
+    }
+
+    test_watchpoint_and_breakpoint
 }
+
+# Restore old timeout
+set timeout $prev_timeout
+verbose "Timeout now $timeout sec.\n"
This page took 0.026119 seconds and 4 git commands to generate.