| OLD | NEW |
| 1 # Copyright 1997-2001, 2003, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 1997-2001, 2003, 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 |
| 11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
| 12 # | 12 # |
| 13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
| 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 |
| 16 # This test was written by Rich Title. | 16 # This test was written by Rich Title. |
| 17 # Purpose is to test conditional breakpoints. | 17 # Purpose is to test conditional breakpoints. |
| 18 # Modeled after "break.exp". | 18 # Modeled after "break.exp". |
| 19 | 19 |
| 20 if $tracelevel then { | |
| 21 strace $tracelevel | |
| 22 } | |
| 23 | |
| 24 global usestubs | |
| 25 | |
| 26 # | 20 # |
| 27 # test running programs | 21 # test running programs |
| 28 # | 22 # |
| 29 | 23 |
| 30 set testfile "break" | 24 set testfile "break" |
| 31 set srcfile ${testfile}.c | 25 set srcfile ${testfile}.c |
| 32 set srcfile1 ${testfile}1.c | 26 set srcfile1 ${testfile}1.c |
| 33 set binfile ${objdir}/${subdir}/${testfile} | 27 set binfile ${objdir}/${subdir}/${testfile} |
| 34 | 28 |
| 35 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debu
g nowarnings}] != "" } { | 29 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debu
g nowarnings}] != "" } { |
| 36 untested condbreak.exp | 30 untested condbreak.exp |
| 37 return -1 | 31 return -1 |
| 38 } | 32 } |
| 39 | 33 |
| 40 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {deb
ug nowarnings}] != "" } { | 34 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {deb
ug nowarnings}] != "" } { |
| 41 untested condbreak.exp | 35 untested condbreak.exp |
| 42 return -1 | 36 return -1 |
| 43 } | 37 } |
| 44 | 38 |
| 45 if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug
nowarnings}] != "" } { | 39 if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug
nowarnings}] != "" } { |
| 46 untested condbreak.exp | 40 untested condbreak.exp |
| 47 return -1 | 41 return -1 |
| 48 } | 42 } |
| 49 | 43 |
| 50 if [get_compiler_info ${binfile}] { | 44 if [get_compiler_info] { |
| 51 return -1; | 45 return -1; |
| 52 } | 46 } |
| 53 | 47 |
| 54 gdb_exit | 48 gdb_exit |
| 55 gdb_start | 49 gdb_start |
| 56 gdb_reinitialize_dir $srcdir/$subdir | 50 gdb_reinitialize_dir $srcdir/$subdir |
| 57 gdb_load ${binfile} | 51 gdb_load ${binfile} |
| 58 | 52 |
| 59 | 53 |
| 60 if [target_info exists gdb_stub] { | |
| 61 gdb_step_for_stub; | |
| 62 } | |
| 63 | |
| 64 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] | 54 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] |
| 65 set bp_location6 [gdb_get_line_number "set breakpoint 6 here"] | 55 set bp_location6 [gdb_get_line_number "set breakpoint 6 here"] |
| 66 set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1] | 56 set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1] |
| 67 set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1] | 57 set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1] |
| 68 set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1] | 58 set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1] |
| 69 set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1] | 59 set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1] |
| 70 set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile1] | 60 set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile1] |
| 71 set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile1] | 61 set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile1] |
| 72 set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile1] | 62 set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile1] |
| 73 set bp_location18 [gdb_get_line_number "set breakpoint 18 here" $srcfile1] | 63 set bp_location18 [gdb_get_line_number "set breakpoint 18 here" $srcfile1] |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 254 |
| 265 set test "run until breakpoint at marker4" | 255 set test "run until breakpoint at marker4" |
| 266 gdb_test_multiple "continue" $test { | 256 gdb_test_multiple "continue" $test { |
| 267 -re "Continuing\\..*Breakpoint \[0-9\]+, marker4 \\(d=177601976\\) at .*$src
file1:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*
$gdb_prompt $" { | 257 -re "Continuing\\..*Breakpoint \[0-9\]+, marker4 \\(d=177601976\\) at .*$src
file1:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*
$gdb_prompt $" { |
| 268 pass $test | 258 pass $test |
| 269 } | 259 } |
| 270 -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker4 \\(d=177601976\\) a
t .*$srcfile1:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[
\t \]+.*$gdb_prompt $" { | 260 -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker4 \\(d=177601976\\) a
t .*$srcfile1:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[
\t \]+.*$gdb_prompt $" { |
| 271 xfail $test | 261 xfail $test |
| 272 } | 262 } |
| 273 } | 263 } |
| 264 |
| 265 gdb_test "complete cond 1" "cond 1" |
| 266 gdb_test "set variable \$var = 1" |
| 267 gdb_test "complete cond \$v" "cond \\\$var" |
| 268 gdb_test "complete cond 1 values\[0\].a" "cond 1 values.0..a_field" |
| OLD | NEW |