Fix more cases of improper test names
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / condbreak.exp
index b8067291d70c0440bff12537eca7e1d73a1e0218..d8c0c250654a94067089a45dfb13c4e3e7ee9220 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1997-2001, 2003, 2007-2012 Free Software Foundation, Inc.
+# Copyright 1997-2016 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
 # Purpose is to test conditional breakpoints.
 # Modeled after "break.exp".
 
-if $tracelevel then {
-       strace $tracelevel
-       }
-
 #
 # test running programs
 #
 
-set testfile "break"
-set srcfile ${testfile}.c
-set srcfile1 ${testfile}1.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
-     untested condbreak.exp
-     return -1
-}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
-     untested condbreak.exp
-     return -1
-}
+standard_testfile break.c break1.c
 
-if  { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
-     untested condbreak.exp
-     return -1
+if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2] \
+        {debug nowarnings}]} {
+    return -1
 }
 
-if [get_compiler_info ${binfile}] {
-    return -1;
+if [get_compiler_info] {
+    return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 
 set bp_location1  [gdb_get_line_number "set breakpoint 1 here"]
 set bp_location6  [gdb_get_line_number "set breakpoint 6 here"]
-set bp_location8  [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
-set bp_location9  [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
-set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1]
-set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1]
-set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile1]
-set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile1]
-set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile1]
-set bp_location18 [gdb_get_line_number "set breakpoint 18 here" $srcfile1]
+set bp_location8  [gdb_get_line_number "set breakpoint 8 here" $srcfile2]
+set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile2]
+set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile2]
+set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile2]
 
 #
 # test break at function
@@ -77,7 +53,7 @@ gdb_test "break main" \
 # test conditional break at function
 #
 gdb_test "break marker1 if 1==1" \
-    "Breakpoint.*at.* file .*$srcfile1, line.*"
+    "Breakpoint.*at.* file .*$srcfile2, line.*"
 
 gdb_test_no_output "delete 2"
 
@@ -93,7 +69,7 @@ gdb_test_no_output "delete 3"
 # test conditional break at function
 #
 gdb_test "break marker1 if (1==1)" \
-    "Breakpoint.*at.* file .*$srcfile1, line.*"
+    "Breakpoint.*at.* file .*$srcfile2, line.*"
 
 #
 # test conditional break at line number
@@ -102,46 +78,32 @@ gdb_test "break $srcfile:$bp_location1 if (1==1)" \
     "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\."
 
 gdb_test "break marker2 if (a==43)" \
-    "Breakpoint.*at.* file .*$srcfile1, line.*"
+    "Breakpoint.*at.* file .*$srcfile2, line.*"
 
 #
 # Check break involving inferior function call.
 # Ensure there is at least one additional breakpoint with higher VMA.
 #
 gdb_test "break marker3 if (multi_line_if_conditional(1,1,1)==0)" \
-    "Breakpoint.*at.* file .*$srcfile1, line.*"
+    "Breakpoint.*at.* file .*$srcfile2, line.*"
 gdb_test "break marker4" \
-    "Breakpoint.*at.* file .*$srcfile1, line.*"
+    "Breakpoint.*at.* file .*$srcfile2, line.*"
 
 #
 # check to see what breakpoints are set
 #
-
-if {$hp_aCC_compiler} {
-    set marker1_proto "\\(void\\)"
-    set marker2_proto "\\(int\\)"
-    # Not checked.
-    set marker3_proto "\\(char \\*, char \\*\\)"
-    set marker4_proto "\\(long\\)"
-} else {
-    set marker1_proto ""
-    set marker2_proto ""
-    set marker3_proto ""
-    set marker4_proto ""
-}
-
 gdb_test "info break" \
     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location6.*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker1$marker1_proto at .*$srcfile1:($bp_location15|$bp_location16).*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker1 at .*$srcfile2:$bp_location15.*
 \[\t \]+stop only if \\(1==1\\).*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location1.*
 \[\t \]+stop only if \\(1==1\\).*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2$marker2_proto at .*$srcfile1:($bp_location8|$bp_location9).*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2 at .*$srcfile2:$bp_location8.*
 \[\t \]+stop only if \\(a==43\\).*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker3$marker3_proto at .*$srcfile1:($bp_location17|$bp_location18).*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker3 at .*$srcfile2:$bp_location17.*
 \[\t \]+stop only if \\(multi_line_if_conditional\\(1,1,1\\)==0\\).*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in marker4$marker4_proto at .*$srcfile1:($bp_location13|$bp_location14).*" \
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker4 at .*$srcfile2:$bp_location14.*" \
     "breakpoint info"
 
 
@@ -199,10 +161,10 @@ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.
 #
 # Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
 gdb_test_multiple "continue" "run until breakpoint at marker1" {
-    -re  "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
+    -re  "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile2:$bp_location15.*$bp_location15\[\t \]+.*$gdb_prompt $" {
        pass "run until breakpoint at marker1"
     }
-    -re  "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
+    -re  "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile2:$bp_location15.*$bp_location15\[\t \]+.*$gdb_prompt $" {
        xfail "run until breakpoint at marker1"
     }
 }
@@ -211,10 +173,10 @@ gdb_test_multiple "continue" "run until breakpoint at marker1" {
 # Same issues here as above.
 setup_xfail hppa2.0w-*-* 11512CLLbs
 gdb_test_multiple "continue" "run until breakpoint at marker2" {
-    -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile2:$bp_location8.*$bp_location8\[\t \]+.*$gdb_prompt $" {
        pass "run until breakpoint at marker2"
     }
-    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile2:$bp_location8.*$bp_location8\[\t \]+.*$gdb_prompt $" {
        xfail "run until breakpoint at marker2"
     }
 }
@@ -248,20 +210,25 @@ gdb_test "break *main if (1==1) ta 999" \
 
 set test "run until breakpoint at marker3"
 gdb_test_multiple "continue" $test {
-    -re "Continuing\\..*Breakpoint \[0-9\]+, marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile1:($bp_location17|$bp_location18).*($bp_location17|$bp_location18)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile2:$bp_location17.*$bp_location17\[\t \]+.*$gdb_prompt $" {
        pass $test
     }
-    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile1:($bp_location17|$bp_location18).*($bp_location17|$bp_location18)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker3 \\(a=$hex \"stack\", b=$hex \"trace\"\\) at .*$srcfile2:$bp_location17.*$bp_location17\[\t \]+.*$gdb_prompt $" {
        xfail $test
     }
 }
 
 set test "run until breakpoint at marker4"
 gdb_test_multiple "continue" $test {
-    -re "Continuing\\..*Breakpoint \[0-9\]+, marker4 \\(d=177601976\\) at .*$srcfile1:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, marker4 \\(d=177601976\\) at .*$srcfile2:$bp_location14.*$bp_location14\[\t \]+.*$gdb_prompt $" {
        pass $test
     }
-    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker4 \\(d=177601976\\) at .*$srcfile1:($bp_location13|$bp_location14).*($bp_location13|$bp_location14)\[\t \]+.*$gdb_prompt $" {
+    -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker4 \\(d=177601976\\) at .*$srcfile2:$bp_location14.*$bp_location14\[\t \]+.*$gdb_prompt $" {
        xfail $test
     }
 }
+
+gdb_test "complete cond 1" "cond 1"
+gdb_test "set variable \$var = 1"
+gdb_test "complete cond \$v" "cond \\\$var"
+gdb_test "complete cond 1 values\[0\].a" "cond 1 values.0..a_field"
This page took 0.029601 seconds and 4 git commands to generate.