diff options
author | Tom Tromey <tromey@adacore.com> | 2024-08-28 07:33:46 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2024-08-30 09:11:12 -0600 |
commit | bcae3bb6509e1111c2859c6b24306aefecdd2570 (patch) | |
tree | 7f0b48a5156e09bff89dca63acc6c10f64bc9265 /gdb/testsuite/gdb.ada | |
parent | 67e30b15212adc1502b898a1ca224fdf65dc110d (diff) | |
download | binutils-bcae3bb6509e1111c2859c6b24306aefecdd2570.zip binutils-bcae3bb6509e1111c2859c6b24306aefecdd2570.tar.gz binutils-bcae3bb6509e1111c2859c6b24306aefecdd2570.tar.bz2 |
Fix regexp quoting in gdb.ada test cases
I noticed that some gdb.ada tests used regular expressions like:
"Continuing\..*$inferior_exited_re.*" \
Here, the "\." should either be "." or "\\." -- "\." is not really
meaningful.
This patch fixes all the cases of this I could find in gdb.ada. In
one test (fun_renaming.exp), using "\\." would result in failures, and
here I rewrote the tests to use -wrap.
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/testsuite/gdb.ada')
-rw-r--r-- | gdb/testsuite/gdb.ada/bp_c_mixed_case.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/bp_inlined_func.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/call_pn.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/catch_assert_if.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/catch_ex.exp | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/catch_ex_std.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/excep_handle.exp | 14 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/fun_overload_menu.exp | 12 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/fun_renaming.exp | 14 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/homonym.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/mi_var_access.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/operator_bp.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/rec_comp.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/task_bp.exp | 2 |
14 files changed, 43 insertions, 43 deletions
diff --git a/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp b/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp index 8ab5f03..2286e46 100644 --- a/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp +++ b/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp @@ -92,14 +92,14 @@ gdb_test "p <NoDebugMixedCaseFunc>" \ set test "break <MixedCaseFunc>, in C" gdb_test_multiple "break <MixedCaseFunc>" $test { - -re "Function \"<MixedCaseFunc>\" not defined\..*Make breakpoint pending on future shared library load.*y or .n.. $" { + -re "Function \"<MixedCaseFunc>\" not defined\\..*Make breakpoint pending on future shared library load.*y or .n.. $" { gdb_test_no_output "n" $test } } set test "break <NoDebugMixedCaseFunc>, in C" gdb_test_multiple "break <NoDebugMixedCaseFunc>" $test { - -re "Function \"<NoDebugMixedCaseFunc>\" not defined\..*Make breakpoint pending on future shared library load.*y or .n.. $" { + -re "Function \"<NoDebugMixedCaseFunc>\" not defined\\..*Make breakpoint pending on future shared library load.*y or .n.. $" { gdb_test_no_output "n" $test } } diff --git a/gdb/testsuite/gdb.ada/bp_inlined_func.exp b/gdb/testsuite/gdb.ada/bp_inlined_func.exp index 761d103..db56a11 100644 --- a/gdb/testsuite/gdb.ada/bp_inlined_func.exp +++ b/gdb/testsuite/gdb.ada/bp_inlined_func.exp @@ -48,5 +48,5 @@ for {set i 0} {$i < 4} {incr i} { } gdb_test "continue" \ - "Continuing\..*$inferior_exited_re.*" \ + "Continuing\\..*$inferior_exited_re.*" \ "continuing to program completion" diff --git a/gdb/testsuite/gdb.ada/call_pn.exp b/gdb/testsuite/gdb.ada/call_pn.exp index 5d3f9d6..5d7e828 100644 --- a/gdb/testsuite/gdb.ada/call_pn.exp +++ b/gdb/testsuite/gdb.ada/call_pn.exp @@ -45,8 +45,8 @@ set xfail_re \ [multi_line \ "Multiple matches for last_node_id" \ "\\\[0\\\] cancel" \ - "\\\[1\\\] pck\.last_node_id at .*.adb:17" \ - "\\\[2\\\] pck\.last_node_id at .*.adb:17" \ + "\\\[1\\\] pck\\.last_node_id at .*.adb:17" \ + "\\\[2\\\] pck\\.last_node_id at .*.adb:17" \ "> $"] # Make sure that last_node_id is set to zero... diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp b/gdb/testsuite/gdb.ada/catch_assert_if.exp index 312b7aa..48b1c85 100644 --- a/gdb/testsuite/gdb.ada/catch_assert_if.exp +++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp @@ -52,9 +52,9 @@ set bp_location [gdb_get_line_number "STOP" ${testdir}/bla.adb] set catchpoint_msg \ "Catchpoint $decimal, failed assertion at $hex in bla \\\(\\\).*at .*bla.adb:$bp_location" gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_msg$eol.*STOP" \ + "Continuing\\.$eol$eol$catchpoint_msg$eol.*STOP" \ "continuing to expected failed assertion" gdb_test "continue" \ - "Continuing\..*$inferior_exited_re.*" \ + "Continuing\\..*$inferior_exited_re.*" \ "continuing to program completion" diff --git a/gdb/testsuite/gdb.ada/catch_ex.exp b/gdb/testsuite/gdb.ada/catch_ex.exp index 0fcc013..48ace25 100644 --- a/gdb/testsuite/gdb.ada/catch_ex.exp +++ b/gdb/testsuite/gdb.ada/catch_ex.exp @@ -55,13 +55,13 @@ gdb_test "info break" \ set catchpoint_msg \ "Catchpoint $any_nb, CONSTRAINT_ERROR (\\\(ignore C_E\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb" gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT1" \ + "Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT1" \ "continuing to first exception" set catchpoint_msg \ "Catchpoint $any_nb, PROGRAM_ERROR (\\\(foo\\.adb:$decimal explicit raise\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb" gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT2" \ + "Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT2" \ "continuing to second exception" ################################################ @@ -108,23 +108,23 @@ gdb_test "info break" \ set catchpoint_msg \ "Catchpoint $any_nb, PROGRAM_ERROR (\\\(foo.adb:$decimal explicit raise\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb" gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT2" \ + "Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT2" \ "continuing to Program_Error exception" set catchpoint_msg \ "Catchpoint $any_nb, failed assertion at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb" gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT3" \ + "Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT3" \ "continuing to failed assertion" set catchpoint_msg \ "Catchpoint $any_nb, unhandled CONSTRAINT_ERROR at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb" gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT4" \ + "Continuing\\.$eol$eol$catchpoint_msg$eol.*SPOT4" \ "continuing to unhandled exception" gdb_test "continue" \ - "Continuing\..*$inferior_exited_re.*" \ + "Continuing\\..*$inferior_exited_re.*" \ "continuing to program completion" ################################# @@ -148,12 +148,12 @@ gdb_test "tcatch exception" \ set temp_catchpoint_msg \ "Temporary catchpoint $any_nb, CONSTRAINT_ERROR (\\\(.*\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb" gdb_test "continue" \ - "Continuing\.$eol$eol$temp_catchpoint_msg$eol.*SPOT1" \ + "Continuing\\.$eol$eol$temp_catchpoint_msg$eol.*SPOT1" \ "continuing to temporary catchpoint" with_test_prefix "temporary catchpoint" { gdb_test "continue" \ - "Continuing\..*$inferior_exited_re.*" \ + "Continuing\\..*$inferior_exited_re.*" \ "continuing to program completion" } diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp index dbd3729..2eae854 100644 --- a/gdb/testsuite/gdb.ada/catch_ex_std.exp +++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp @@ -73,7 +73,7 @@ gdb_test "catch exception some_kind_of_error" \ "Catchpoint \[0-9\]+: `some_kind_of_error' Ada exception" gdb_test "cont" \ - "Catchpoint \[0-9\]+, .* at .*foo\.adb:\[0-9\]+.*" \ + "Catchpoint \[0-9\]+, .* at .*foo\\.adb:\[0-9\]+.*" \ "caught the exception" gdb_test "print \$_ada_exception = some_package.some_kind_of_error'Address" \ diff --git a/gdb/testsuite/gdb.ada/excep_handle.exp b/gdb/testsuite/gdb.ada/excep_handle.exp index ad92aff..2a99457 100644 --- a/gdb/testsuite/gdb.ada/excep_handle.exp +++ b/gdb/testsuite/gdb.ada/excep_handle.exp @@ -55,7 +55,7 @@ gdb_test "catch handlers" \ # Continue. The program should stop at first exception handling. gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_constraint_error_msg" \ + "Continuing\\.$eol$eol$catchpoint_constraint_error_msg" \ "continuing to first Constraint_Error exception handlers" # Resume the program's exception. @@ -66,7 +66,7 @@ gdb_test "continue" \ # the next exception being raised. gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_storage_error_msg" \ + "Continuing\\.$eol$eol$catchpoint_storage_error_msg" \ "continuing and stopping in Storage_Error exception handlers" gdb_test_no_output "delete 2" \ @@ -85,7 +85,7 @@ gdb_test "catch handlers Program_Error" \ # Continue, we should not stop at ABORT_SIGNAL but at Program_Error one. gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_program_error_msg" \ + "Continuing\\.$eol$eol$catchpoint_program_error_msg" \ "continuing without stopping to Program_Error exception handlers" gdb_test_no_output \ @@ -101,7 +101,7 @@ gdb_test "catch handlers Storage_Error" \ # Continue, we should stop at Storage_Error handlers. gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_storage_error_msg" \ + "Continuing\\.$eol$eol$catchpoint_storage_error_msg" \ "continuing without stopping to Storage_Error exception handlers" gdb_test_no_output \ @@ -126,7 +126,7 @@ gdb_test "info breakpoint" "stop only if Global_Var = 2" \ # Continue, we should not stop at ABORT_SIGNAL but at Program_Error one. gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_constraint_error_msg" \ + "Continuing\\.$eol$eol$catchpoint_constraint_error_msg" \ "continuing to second Constraint_Error exception handlers" gdb_test_no_output \ @@ -148,11 +148,11 @@ gdb_test "catch handlers Program_Error if Global_Var = 4" \ # the second one. gdb_test "continue" \ - "Continuing\.$eol$eol$catchpoint_program_error_msg" \ + "Continuing\\.$eol$eol$catchpoint_program_error_msg" \ "continuing to Program_Error exception handlers" # Continue, the program should exit properly. gdb_test "continue" \ - "Continuing\..*$inferior_exited_re.*" \ + "Continuing\\..*$inferior_exited_re.*" \ "continuing to program completion" diff --git a/gdb/testsuite/gdb.ada/fun_overload_menu.exp b/gdb/testsuite/gdb.ada/fun_overload_menu.exp index ec5465d..8e7a3fb 100644 --- a/gdb/testsuite/gdb.ada/fun_overload_menu.exp +++ b/gdb/testsuite/gdb.ada/fun_overload_menu.exp @@ -54,8 +54,8 @@ proc test_menu {expr function menu_entries selection output} { with_test_prefix "func" { test_menu "f (1, null)" "f" \ [multi_line \ - "\\\[1\\\] foo\.f \\(integer; foo\.integer_access\\) return boolean at .*foo.adb:.*" \ - "\\\[2\\\] foo\.f \\(foo\.new_integer; foo\.integer_access\\) return boolean at .*foo.adb:.*"] \ + "\\\[1\\\] foo\\.f \\(integer; foo\\.integer_access\\) return boolean at .*foo.adb:.*" \ + "\\\[2\\\] foo\\.f \\(foo\\.new_integer; foo\\.integer_access\\) return boolean at .*foo.adb:.*"] \ "1" "= true" } @@ -63,8 +63,8 @@ with_test_prefix "func" { with_test_prefix "proc" { test_menu "p (1, null)" "p" \ [multi_line \ - "\\\[1\\\] foo\.p \\(integer; foo\.integer_access\\) at .*foo.adb:.*" \ - "\\\[2\\\] foo\.p \\(foo\.new_integer; foo\.integer_access\\) at .*foo.adb:.*" ] \ + "\\\[1\\\] foo\\.p \\(integer; foo\\.integer_access\\) at .*foo.adb:.*" \ + "\\\[2\\\] foo\\.p \\(foo\\.new_integer; foo\\.integer_access\\) at .*foo.adb:.*" ] \ "1" "= (void)" } @@ -73,7 +73,7 @@ gdb_test "set ada print-signatures off" "" with_test_prefix "signatures disabled" { test_menu "f (1, null)" "f" \ [multi_line \ - "\\\[1\\\] foo\.f at .*foo.adb:.*" \ - "\\\[2\\\] foo\.f at .*foo.adb:.*"] \ + "\\\[1\\\] foo\\.f at .*foo.adb:.*" \ + "\\\[2\\\] foo\\.f at .*foo.adb:.*"] \ "1" "= true" } diff --git a/gdb/testsuite/gdb.ada/fun_renaming.exp b/gdb/testsuite/gdb.ada/fun_renaming.exp index 33c9b95..08c44b7 100644 --- a/gdb/testsuite/gdb.ada/fun_renaming.exp +++ b/gdb/testsuite/gdb.ada/fun_renaming.exp @@ -37,10 +37,10 @@ gdb_test "print fun_rename_test_next(1)" " = 2" set test "print fun_rename_test_n(1)" gdb_test_multiple $test $test { - -re " = 2\..*$gdb_prompt $" { + -wrap -re " = 2" { pass $test } - -re "No definition of \"fun_rename_test_n\" in current context\..*$gdb_prompt $" { + -wrap -re "No definition of \"fun_rename_test_n\" in current context\\." { if {[test_compiler_info {gcc-6*}]} { fail $test } else { @@ -51,10 +51,10 @@ gdb_test_multiple $test $test { } set test "print renamed_fun_rename_test_next(1)" gdb_test_multiple $test $test { - -re " = 2\..*$gdb_prompt $" { + -wrap -re " = 2" { pass $test } - -re "No definition of \"renamed_fun_rename_test_next\" in current context\..*$gdb_prompt $" { + -wrap -re "No definition of \"renamed_fun_rename_test_next\" in current context\\." { if {[test_compiler_info {gcc-6*}]} { fail $test } else { @@ -65,17 +65,17 @@ gdb_test_multiple $test $test { set test "print pack.renamed_fun_rename_test_next(1)" gdb_test_multiple $test $test { - -re " = 2\..*$gdb_prompt $" { + -wrap -re " = 2" { pass $test } - -re "No definition of \"pack\.renamed_fun_rename_test_next\" in current context\..*$gdb_prompt $" { + -wrap -re "No definition of \"pack\\.renamed_fun_rename_test_next\" in current context\\." { if {[test_compiler_info {gcc-6*}]} { fail $test } else { xfail $test } } - -re "Type <data variable, no debug info> is not a structure or union type\..*$gdb_prompt $" { + -wrap -re "Type <data variable, no debug info> is not a structure or union type\\." { if {[test_compiler_info {gcc-6*}]} { fail $test } else { diff --git a/gdb/testsuite/gdb.ada/homonym.exp b/gdb/testsuite/gdb.ada/homonym.exp index 64a6edf..91a4e62 100644 --- a/gdb/testsuite/gdb.ada/homonym.exp +++ b/gdb/testsuite/gdb.ada/homonym.exp @@ -76,7 +76,7 @@ gdb_test "print lcl" \ set bp_location [gdb_get_line_number "BREAK_2" ${testdir}/homonym.adb] gdb_test "break homonym.adb:$bp_location" \ - "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: file .*homonym\.adb, line \[0-9\]+\." \ + "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: file .*homonym\\.adb, line \[0-9\]+\\." \ "break at BREAK_2" gdb_test "continue" \ diff --git a/gdb/testsuite/gdb.ada/mi_var_access.exp b/gdb/testsuite/gdb.ada/mi_var_access.exp index e797a15..15419bb 100644 --- a/gdb/testsuite/gdb.ada/mi_var_access.exp +++ b/gdb/testsuite/gdb.ada/mi_var_access.exp @@ -41,7 +41,7 @@ mi_continue_to_line \ # The value of NUMCHILD may vary on different systems. Use generic $decimal # to match possible values. set re_ok "\\^done,name=\"A_String_Access\",numchild=\"$decimal\",.*" -set re_error "\\^error,msg=\"Value out of range\.\".*" +set re_error "\\^error,msg=\"Value out of range\\.\".*" set re_error2 "\\^error,msg=\"Cannot access memory at address $hex\"" mi_gdb_test "-var-create A_String_Access * A_String_Access" \ "($re_ok|$re_error|$re_error2)" \ diff --git a/gdb/testsuite/gdb.ada/operator_bp.exp b/gdb/testsuite/gdb.ada/operator_bp.exp index ff81a9f..2335d49 100644 --- a/gdb/testsuite/gdb.ada/operator_bp.exp +++ b/gdb/testsuite/gdb.ada/operator_bp.exp @@ -36,7 +36,7 @@ runto "ops_test.adb:$bp_location" set bp_re "Breakpoint $decimal at $hex" foreach op { "+" "-" } { set op_re [string_to_regexp $op] - gdb_test "break \"$op\"" "$bp_re: \"$op_re\"\. \\($decimal locations\\).*" + gdb_test "break \"$op\"" "$bp_re: \"$op_re\"\\. \\($decimal locations\\).*" } foreach op { "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} { @@ -45,7 +45,7 @@ foreach op { "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" -re -wrap "$bp_re: file .*ops.adb, line $decimal." { pass $gdb_test_name } - -re -wrap "$bp_re: \"$op_re\"\. \\($decimal locations\\).*" { + -re -wrap "$bp_re: \"$op_re\"\\. \\($decimal locations\\).*" { pass $gdb_test_name } } @@ -72,7 +72,7 @@ runto "ops_test.adb:$bp_location" foreach op { "+" "-" } { set op_re [string_to_regexp $op] gdb_test "break ops.\"$op\"" \ - "Breakpoint $decimal at $hex: ops\\.\"$op_re\"\. \\(2 locations\\)" + "Breakpoint $decimal at $hex: ops\\.\"$op_re\"\\. \\(2 locations\\)" } foreach op { "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} { diff --git a/gdb/testsuite/gdb.ada/rec_comp.exp b/gdb/testsuite/gdb.ada/rec_comp.exp index 4638786..641ebb6 100644 --- a/gdb/testsuite/gdb.ada/rec_comp.exp +++ b/gdb/testsuite/gdb.ada/rec_comp.exp @@ -33,6 +33,6 @@ if {![runto "bar_o203_012.adb:$bp_location"]} { gdb_test "whatis r.ia" " = bar_o203_012.int_access" gdb_test "ptype r" \ - " = record\r\n *ia: bar_o203_012\.int_access;\r\nend record" + " = record\r\n *ia: bar_o203_012\\.int_access;\r\nend record" gdb_test "ptype r.ia" " = access <$decimal-byte integer>" diff --git a/gdb/testsuite/gdb.ada/task_bp.exp b/gdb/testsuite/gdb.ada/task_bp.exp index cf6251e..4b32a3d 100644 --- a/gdb/testsuite/gdb.ada/task_bp.exp +++ b/gdb/testsuite/gdb.ada/task_bp.exp @@ -37,7 +37,7 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } proc test_bp { loc msg } { gdb_test "break $loc" \ - "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: file .*pck.adb, line \[0-9\]+\." \ + "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: file .*pck.adb, line \[0-9\]+\\." \ "break $loc - $msg" gdb_run_cmd |