| OLD | NEW |
| 1 # Copyright 1999-2004, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 1999-2004, 2007-2012 Free Software Foundation, Inc. |
| 2 | 2 |
| 3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
| 4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
| 5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. | 6 # (at your option) any later version. |
| 7 # | 7 # |
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 # | 25 # |
| 26 | 26 |
| 27 load_lib mi-support.exp | 27 load_lib mi-support.exp |
| 28 set MIFLAGS "-i=mi2" | 28 set MIFLAGS "-i=mi2" |
| 29 | 29 |
| 30 gdb_exit | 30 gdb_exit |
| 31 if [mi_gdb_start] { | 31 if [mi_gdb_start] { |
| 32 continue | 32 continue |
| 33 } | 33 } |
| 34 | 34 |
| 35 set testfile "basics" | 35 standard_testfile basics.c |
| 36 set srcfile ${testfile}.c | 36 |
| 37 set binfile ${objdir}/${subdir}/mi2-watch | 37 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug}] != "" } { |
| 38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug additional_flags=-DFAKEARGV}] != "" } { | |
| 39 untested mi2-watch.exp | 38 untested mi2-watch.exp |
| 40 return -1 | 39 return -1 |
| 41 } | 40 } |
| 42 | 41 |
| 43 proc test_watchpoint_creation_and_listing {type} { | 42 proc test_watchpoint_creation_and_listing {type} { |
| 44 global mi_gdb_prompt | 43 global mi_gdb_prompt |
| 45 global srcfile | 44 global srcfile |
| 46 global hex | 45 global hex |
| 47 | 46 |
| 48 set line_callee4_head [gdb_get_line_number "callee4 ("] | 47 set line_callee4_head [gdb_get_line_number "callee4 ("] |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 if { $type == "sw" } { | 138 if { $type == "sw" } { |
| 140 setup_xfail *-*-* | 139 setup_xfail *-*-* |
| 141 } | 140 } |
| 142 mi_execute_to "exec-continue" "watchpoint-scope" "callee3" ".*" \ | 141 mi_execute_to "exec-continue" "watchpoint-scope" "callee3" ".*" \ |
| 143 ".*basics.c" $line_callee3_close_brace \ | 142 ".*basics.c" $line_callee3_close_brace \ |
| 144 {"" "wpnum=\"2\""} \ | 143 {"" "wpnum=\"2\""} \ |
| 145 "watchpoint trigger" | 144 "watchpoint trigger" |
| 146 clear_xfail *-*-* | 145 clear_xfail *-*-* |
| 147 } | 146 } |
| 148 | 147 |
| 149 proc test_watchpoint_all {type} { | 148 proc test_watchpoint_all {type} { with_test_prefix "$type" { |
| 150 global pf_prefix | |
| 151 upvar srcdir srcdir | 149 upvar srcdir srcdir |
| 152 upvar subdir subdir | 150 upvar subdir subdir |
| 153 upvar binfile binfile | 151 upvar binfile binfile |
| 154 | 152 |
| 155 set old_prefix $pf_prefix | |
| 156 lappend pf_prefix "$type:" | |
| 157 | |
| 158 mi_delete_breakpoints | 153 mi_delete_breakpoints |
| 159 mi_gdb_reinitialize_dir $srcdir/$subdir | 154 mi_gdb_reinitialize_dir $srcdir/$subdir |
| 160 mi_gdb_load ${binfile} | 155 mi_gdb_load ${binfile} |
| 161 | 156 |
| 162 mi_runto callee4 | 157 mi_runto callee4 |
| 163 test_watchpoint_creation_and_listing $type | 158 test_watchpoint_creation_and_listing $type |
| 164 #test_rwatch_creation_and_listing $type | 159 #test_rwatch_creation_and_listing $type |
| 165 #test_awatch_creation_and_listing $type | 160 #test_awatch_creation_and_listing $type |
| 166 test_watchpoint_triggering $type | 161 test_watchpoint_triggering $type |
| 167 | 162 }} |
| 168 set pf_prefix $old_prefix | |
| 169 } | |
| 170 | 163 |
| 171 # Run the tests twice, once using software watchpoints... | 164 # Run the tests twice, once using software watchpoints... |
| 172 mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \ | 165 mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \ |
| 173 "567\\^done" \ | 166 "567\\^done" \ |
| 174 "hw watchpoints toggle (1)" | 167 "hw watchpoints toggle (1)" |
| 175 test_watchpoint_all sw | 168 test_watchpoint_all sw |
| 176 | 169 |
| 177 mi_gdb_exit | 170 mi_gdb_exit |
| 178 | 171 |
| 179 # ... and unless requested otherwise... | 172 # ... and unless requested otherwise... |
| 180 if [target_info exists gdb,no_hardware_watchpoints] { | 173 if [target_info exists gdb,no_hardware_watchpoints] { |
| 181 return 0 | 174 return 0 |
| 182 } | 175 } |
| 183 | 176 |
| 184 mi_gdb_start | 177 mi_gdb_start |
| 185 | 178 |
| 186 # ... once using hardware watchpoints (if available). | 179 # ... once using hardware watchpoints (if available). |
| 187 mi_gdb_test "890-gdb-set can-use-hw-watchpoints 1" \ | 180 mi_gdb_test "890-gdb-set can-use-hw-watchpoints 1" \ |
| 188 "890\\^done" \ | 181 "890\\^done" \ |
| 189 "hw watchpoints toggle (2)" | 182 "hw watchpoints toggle (2)" |
| 190 test_watchpoint_all hw | 183 test_watchpoint_all hw |
| 191 | 184 |
| 192 mi_gdb_exit | 185 mi_gdb_exit |
| 193 return 0 | 186 return 0 |
| OLD | NEW |