]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite: change newline patterns used in gdb_test
authorAndrew Burgess <aburgess@redhat.com>
Thu, 30 Mar 2023 12:26:25 +0000 (13:26 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Thu, 27 Apr 2023 12:56:37 +0000 (13:56 +0100)
This commit makes two changes to how we match newline characters in
the gdb_test proc.

First, for the newline pattern between the command output and the
prompt, I propose changing from '[\r\n]+' to an explicit '\r\n'.

The old pattern would spot multiple newlines, and so there are a few
places where, as part of this commit, I've needed to add an extra
trailing '\r\n' to the pattern in the main test file, where GDB's
output actually includes a blank line.

But I think this is a good thing.  If a command produces a blank line
then we should be checking for it, the current gdb_test doesn't do
that.  But also, with the current gdb_test, if a blank line suddenly
appears in the output, this is going to be silently ignored, and I
think this is wrong, the test should fail in that case.

Additionally, the existing pattern will happily match a partial
newline.  There are a strangely large number of tests that end with a
random '.' character.  Not matching a literal period, but matching any
single character, this is then matching half of the trailing newline
sequence, while the \[\r\n\]+ in gdb_test is matching the other half
of the sequence.  I can think of no reason why this would be
intentional, I suspect that the expected output at one time included a
period, which has since been remove, but I haven't bothered to check
on this.  In this commit I've removed all these unneeded trailing '.'
characters.

The basic rule of gdb_test after this is that the expected pattern
needs to match everything up to, but not including the newline
sequence immediately before the GDB prompt.  This is generally how the
proc is used anyway, so in almost all cases, this commit represents no
significant change.

Second, while I was cleaning up newline matching in gdb_test, I've
also removed the '[\r\n]*' that was added to the start of the pattern
passed to gdb_test_multiple.

The addition of this pattern adds no value.  If the user pattern
matches at the start of a line then this would match against the
newline sequence.  But, due to the '*', if the user pattern doesn't
match at the start of a line then this group doesn't care, it'll
happily match nothing.

As such, there's no value to it, it just adds more complexity for no
gain, so I'm removing it.  No tests will need updating as a
consequence of this part of the patch.

Reviewed-By: Tom Tromey <tom@tromey.com>
39 files changed:
gdb/testsuite/gdb.ada/varsize_limit.exp
gdb/testsuite/gdb.base/call-rt-st.exp
gdb/testsuite/gdb.base/charset.exp
gdb/testsuite/gdb.base/default.exp
gdb/testsuite/gdb.base/display.exp
gdb/testsuite/gdb.base/foll-fork.exp
gdb/testsuite/gdb.base/info-macros.exp
gdb/testsuite/gdb.base/pc-fp.exp
gdb/testsuite/gdb.base/pending.exp
gdb/testsuite/gdb.base/rtld-step.exp
gdb/testsuite/gdb.base/setshow.exp
gdb/testsuite/gdb.base/until.exp
gdb/testsuite/gdb.base/watch-bitfields.exp
gdb/testsuite/gdb.base/wrong_frame_bt_full.exp
gdb/testsuite/gdb.btrace/buffer-size.exp
gdb/testsuite/gdb.btrace/function_call_history.exp
gdb/testsuite/gdb.btrace/instruction_history.exp
gdb/testsuite/gdb.btrace/record_goto.exp
gdb/testsuite/gdb.cp/incomplete-type-overload.exp
gdb/testsuite/gdb.cp/maint.exp
gdb/testsuite/gdb.cp/ovldbreak.exp
gdb/testsuite/gdb.cp/userdef.exp
gdb/testsuite/gdb.cp/virtfunc.exp
gdb/testsuite/gdb.guile/scm-breakpoint.exp
gdb/testsuite/gdb.guile/scm-cmd.exp
gdb/testsuite/gdb.opt/inline-break.exp
gdb/testsuite/gdb.python/py-breakpoint.exp
gdb/testsuite/gdb.reverse/machinestate-precsave.exp
gdb/testsuite/gdb.reverse/machinestate.exp
gdb/testsuite/gdb.stabs/exclfwd.exp
gdb/testsuite/gdb.threads/foll-fork-other-thread.exp
gdb/testsuite/gdb.threads/gcore-thread.exp
gdb/testsuite/gdb.trace/actions.exp
gdb/testsuite/gdb.trace/deltrace.exp
gdb/testsuite/gdb.trace/infotrace.exp
gdb/testsuite/gdb.trace/passcount.exp
gdb/testsuite/gdb.trace/tracecmd.exp
gdb/testsuite/gdb.trace/while-stepping.exp
gdb/testsuite/lib/gdb.exp

index ceb0c8594a7ce85f7ee5563c120503dc7b509489..64f2e3fa2896989d507e309cec35fd1d0b3c1cbc 100644 (file)
@@ -31,7 +31,7 @@ if {![runto "vsizelim.adb:$bp_location"]} {
 }
 
 gdb_test "set varsize-limit 16" \
-    "Warning: command 'set varsize-limit' is deprecated.\r\nUse 'set max-value-size'."
+    "Warning: command 'set varsize-limit' is deprecated.\r\nUse 'set max-value-size'\\.\r\n"
 
 gdb_test "print small" " = \"1234567890\""
 
index 63db4c56d574f000d8aa11cd765340fd8c223b6c..d9c9abe604f57b7e01b0bc70650a272846a5a1f8 100644 (file)
@@ -56,7 +56,7 @@ gdb_test "break loop_count" \
     "breakpoint loop_count"
 
 gdb_test "continue" \
-    "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+$stop_line\[\t \]+for \\(index=0; index.4; index..\\);.*\[\r\n \]+" \
+    "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+$stop_line\[\t \]+for \\(index=0; index.4; index..\\);.*" \
     "continue to loop_count"
 
 gdb_test_multiple "finish" "finish out from loop count" {
index 1387e171882e63e348f33ec7ba88721f9c45eab6..34b4c7134b9a83dc79a778939a1bda2f47d8c787 100644 (file)
@@ -496,8 +496,8 @@ gdb_test_no_output "set target-charset UTF-8"
 gdb_test "print \"\\242\"" " = \"\\\\242\"" \
   "non-representable target character"
 
-gdb_test "print '\\x'" "\\\\x escape without a following hex digit."
-gdb_test "print '\\u'" "\\\\u escape without a following hex digit."
+gdb_test "print '\\x'" "\\\\x escape without a following hex digit"
+gdb_test "print '\\u'" "\\\\u escape without a following hex digit"
 gdb_test "print '\\9'" " = \[0-9\]+ '9'"
 
 # An octal escape can only be 3 digits.
index 7e73db0576a729fd277d79c56f2a9df8cb064ebc..3c5e8b7598d8b6d9b1dfb87af4e4bf8657f931e1 100644 (file)
@@ -386,8 +386,8 @@ gdb_test "overlay list"   "No sections are mapped."
 gdb_test "overlay map"    "Overlay debugging not enabled.*" "overlay map #1"
 gdb_test "overlay unmap"  "Overlay debugging not enabled.*" "overlay unmap #1"
 gdb_test_no_output "overlay manual" "overlay manual #2"
-gdb_test "overlay map"    "Argument required: name of an overlay section." "overlay map #2"
-gdb_test "overlay unmap"  "Argument required: name of an overlay section." "overlay unmap #2"
+gdb_test "overlay map"    "Argument required: name of an overlay section" "overlay map #2"
+gdb_test "overlay unmap"  "Argument required: name of an overlay section" "overlay unmap #2"
 
 #test print "p" abbreviation
 gdb_test "p" "The history is empty." "print \"p\" abbreviation"
index 79ef4d894e8a34c190d4b9bcfd589e6f719e2fd4..6978aedff43f42dc2280938286b934dd40b22486 100644 (file)
@@ -191,11 +191,11 @@ gdb_test "printf \"%p\\n\", 1" "0x1"
 # play with "print", too
 #
 gdb_test "print/k j" ".*Undefined output format.*"
-gdb_test "print/d j" " = 0\[\\r\\n\]+"   "debug test output 1"
-gdb_test "print/r j" " = 0\[\\r\\n\]+"   "debug test output 1a"
-gdb_test "print/x j" " = 0x0\[\\r\\n\]+" "debug test output 2"
-gdb_test "print/r j" " = 0x0\[\\r\\n\]+" "debug test output 2a"
-gdb_test "print j"   " = 0\[\\r\\n\]+"   "debug test output 3"
+gdb_test "print/d j" " = 0"   "debug test output 1"
+gdb_test "print/r j" " = 0"   "debug test output 1a"
+gdb_test "print/x j" " = 0x0" "debug test output 2"
+gdb_test "print/r j" " = 0x0" "debug test output 2a"
+gdb_test "print j"   " = 0"   "debug test output 3"
 
 # x/0 j doesn't produce any output and terminates PA64 process when testing
 gdb_test_no_output "x/0 j"
index df5dab056c219ca2e79320057ba651b3f042dbd1..b0ba156e3dba05f5c1a654bb451b17eb3c2c32e8 100644 (file)
@@ -234,7 +234,7 @@ proc_with_prefix catch_fork_child_follow {second_inferior} {
     # Verify that the catchpoint is mentioned in an "info breakpoints",
     # and further that the catchpoint mentions no process id.
     gdb_test "info breakpoints" \
-       ".*catchpoint.*keep y.*fork\[\r\n\]+" \
+       ".*catchpoint.*keep y.*fork" \
        "info breakpoints before fork"
 
     gdb_test "continue" \
index 38eb35f1df8710049c61ea1e3882a8b034b8d9c5..fd4a99c9794979d28625545ee52bb0c539bfb9c4 100644 (file)
@@ -33,22 +33,22 @@ gdb_test "info macro  -- -all" \
         "The symbol `-all' has no definition .*\r\nat .*$srcfile:\[0-9\]+"
 
 gdb_test "info macro -all --" \
-        "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]"
+        "You must follow.*with the name.*you want to see.*\[^\r\n\]*"
 
 gdb_test "info macro -all  --" \
-        "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]"
+        "You must follow.*with the name.*you want to see.*\[^\r\n\]*"
 
 gdb_test "info macro  -all  --" \
-        "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]"
+        "You must follow.*with the name.*you want to see.*\[^\r\n\]*"
 
 gdb_test "info macro --" \
-        "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]"
+        "You must follow.*with the name.*you want to see.*\[^\r\n\]*"
 
 gdb_test "info macro -- " \
-        "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \
+        "You must follow.*with the name.*you want to see.*\[^\r\n\]*" \
         "info macro -- <EOL>"
 gdb_test "info macro  -- " \
-        "You must follow.*with the name.*you want to see.*\[^\r\n\]*\[\r\n\]" \
+        "You must follow.*with the name.*you want to see.*\[^\r\n\]*" \
         "info macro  -- <EOL>"
 
 gdb_test "info macro -invalid-option" \
index e7ebd3804cb30994e7a978fe257e14ca76b6c9c2..466a6d62395dc43632a988b14118ef5f34c4c9de 100644 (file)
@@ -53,4 +53,4 @@ gdb_test "info register \$fp" "${valueof_fp}.*"
 # Regression test for
 # http://sourceware.org/bugzilla/show_bug.cgi?id=12659
 gdb_test "info register pc fp" \
-    "pc +${valueof_pc}\[ \t\]+${valueof_pc} <.*>\[\r\n\]+fp +${valueof_fp}\[ \t\]+${valueof_fp}\[\r\n\]+"
+    "pc +${valueof_pc}\[ \t\]+${valueof_pc} <.*>\[\r\n\]+fp +${valueof_fp}\[ \t\]+${valueof_fp}"
index be54fb1ce08628e4cfa357fe6fcbc601bd9cabe3..d7d3735000aa7622766c8cdc83cd4456cb288cc3 100644 (file)
@@ -225,7 +225,7 @@ gdb_test "continue" \
 
 gdb_test "continue" \
 ".*Breakpoint.*pendfunc1.*at.*pendshr.c:$bp2_loc.*
-\[$\]1 = 1." \
+\\\$1 = 1" \
 "continue to resolved breakpoint 1"
 
 #
index f2cf0b149964252447d2452dfc01118b619b3804..9a6c76d191acbb0b89779bcc1f67a01808f8edfc 100644 (file)
@@ -140,7 +140,7 @@ gdb_test "step" {baz \(.*?\);} "step into foo 1"
 gdb_test "finish" {Run till exit.*bar \(\).*baz.*} "finish out of foo 1"
 gdb_test "next" {foo \(2\);} "next over baz in bar"
 gdb_test "step" {baz \(.*?\);} "step into foo 2"
-gdb_test "next" "\}\[\r\n\]+" "next over baz in foo"
-gdb_test "step" "bar \\(\\).*}\[\r\n\]+.*" "step out of foo back into bar"
+gdb_test "next" "\}" "next over baz in foo"
+gdb_test "step" "bar \\(\\).*}" "step out of foo back into bar"
 
 gdb_continue_to_end
index 86821ca1db083dfff848c2eff27648ff6f458bf5..8c160aa560ee9c2e08a0522bb6612fccbfd34c7b 100644 (file)
@@ -297,10 +297,10 @@ proc_with_prefix test_setshow_history {} {
        "The filename in which to record the command history is \"[string_to_regexp $HOME]/foobar.baz\"..*" \
        "show history filename (~/foobar.baz)"
     gdb_test "p \$_gdb_setting(\"history filename\")" \
-       " = \"[string_to_regexp $HOME]/foobar.baz\"..*" \
+       " = \"[string_to_regexp $HOME]/foobar.baz\"" \
        "_gdb_setting history filename"
     gdb_test "p \$_gdb_setting_str(\"history filename\")" \
-       " = \"[string_to_regexp $HOME]/foobar.baz\"..*" \
+       " = \"[string_to_regexp $HOME]/foobar.baz\"" \
        "_gdb_setting_str history filename"
 
     #get current working directory
index e1a1765ec2e95dd067430cc9ac433b544fb9387b..4a1a07dae7adf53c2852b66ddf7f4e580ac4832f 100644 (file)
@@ -39,7 +39,7 @@ gdb_test "until $bp_location1" \
 # Verify that a malformed "advance" is gracefully caught.
 #
 gdb_test "until 80 then stop" \
-    "malformed linespec error: unexpected string, \"then stop\"." \
+    "malformed linespec error: unexpected string, \"then stop\"" \
     "malformed until"
 
 # Rerun up to factorial, outer invocation
index ce2aee2ac183d3bedfbf51cbe4f65cf536ba6620..95573caa7dd1a352c1c06c777a9cf24d0b13c916 100644 (file)
@@ -44,9 +44,9 @@ proc watch { expr } {
 proc expect_watchpoint { expr old new } {
     with_test_prefix "$expr: $old->$new" {
        set expr_re [string_to_regexp $expr]
-       gdb_test "print $expr" "\\$\\d+ = $old\\s" "print expression before"
+       gdb_test "print $expr" "\\$\\d+ = $old" "print expression before"
        gdb_test "continue" "$expr_re\\s.*Old value = $old\\s+New value = $new\\s.*"
-       gdb_test "print $expr" "\\$\\d+ = $new\\s" "print expression after"
+       gdb_test "print $expr" "\\$\\d+ = $new" "print expression after"
     }
 }
 
index 2ab0133cfe641c82575eaab66a61e7e48846b895..5321cdcbac65ae8c9822300549fa1e60a3a0a3c0 100644 (file)
@@ -51,6 +51,4 @@ if ![runto opaque_routine] {
 # correctly when frame #0 (the frame which does not have any debugging
 # info) is the selected frame.
 
-gdb_test "bt full" \
-         ".*\[\r\n\]+ *my_table = \\{0, 1, 2\\}\[\r\n\]+.*"
-
+gdb_test "bt full" ".*\[\r\n\]+ *my_table = \\{0, 1, 2\\}"
index e632ba56cf9cf378dccaaa28053aa0bf253b5260..616c7f170e5fdff15b3afe4ddedcc651600f54ab 100644 (file)
@@ -30,8 +30,8 @@ if ![runto_main] {
 
 gdb_test_no_output "set record btrace bts buffer-size 1"
 gdb_test_no_output "set record btrace pt buffer-size 1"
-gdb_test "show record btrace bts buffer-size" "The record/replay bts buffer size is 1\.\r"
-gdb_test "show record btrace pt buffer-size" "The record/replay pt buffer size is 1\.\r"
+gdb_test "show record btrace bts buffer-size" "The record/replay bts buffer size is 1\."
+gdb_test "show record btrace pt buffer-size" "The record/replay pt buffer size is 1\."
 
 gdb_test_no_output "record btrace"
 gdb_test "info record" [multi_line \
index e71e48fc0ca9739e3e0998c4b2d629c2d2f82f42..de4cdf9783d99c9c9825786f78db3a600eaccddc 100644 (file)
@@ -187,7 +187,7 @@ set expected_range [multi_line \
 gdb_test "record function-call-history 4,10" $expected_range
 gdb_test "record function-call-history 4,+7" $expected_range
 gdb_test "record function-call-history 10,-7" $expected_range
-gdb_test "record function-call-history 4,4" "4\tinc\r"
+gdb_test "record function-call-history 4,4" "4\tinc"
 
 # set bp after fib recursion and continue
 set bp_location [gdb_get_line_number "bp.2" $testfile.c]
index 35b43d6843408d904532650cfd73055e3da4d639..f6c1fae720fe6fbbc527b35296e13bceed6b2030 100644 (file)
@@ -69,7 +69,7 @@ gdb_test "record instruction-history 3,7" [multi_line \
   "4\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tdec    %eax" \
   "5\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tjmp    0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
   "6\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tcmp    \\\$0x0,%eax" \
-  "7\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r" \
+  "7\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
   ]
 
 gdb_test "record instruction-history /f 3,+5" [multi_line \
@@ -77,7 +77,7 @@ gdb_test "record instruction-history /f 3,+5" [multi_line \
   "4\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tdec    %eax" \
   "5\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tjmp    0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
   "6\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tcmp    \\\$0x0,%eax" \
-  "7\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r" \
+  "7\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
   ]
 
 gdb_test "record instruction-history /p 7,-5" [multi_line \
@@ -85,7 +85,7 @@ gdb_test "record instruction-history /p 7,-5" [multi_line \
   "4\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tdec    %eax" \
   "5\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tjmp    0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
   "6\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tcmp    \\\$0x0,%eax" \
-  "7\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r" \
+  "7\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
   ]
 
 gdb_test "record instruction-history /pf 3,7" [multi_line \
@@ -93,10 +93,10 @@ gdb_test "record instruction-history /pf 3,7" [multi_line \
   "4\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tdec    %eax" \
   "5\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tjmp    0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
   "6\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tcmp    \\\$0x0,%eax" \
-  "7\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r" \
+  "7\t   0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
   ]
 
-gdb_test "record instruction-history 3,3" "3\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r"
+gdb_test "record instruction-history 3,3" "3\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>"
 
 # the following tests are checking the iterators
 # to avoid lots of regexps, we just check the number of lines that
index 240e18f67d69d07bfa626b7bb4775f5ce95bdcec..1817ac07f5129615faa96b21ffd0376ba178c494 100644 (file)
@@ -149,7 +149,7 @@ gdb_test "record goto 2" ".*fun4 \\(\\) at record_goto.c:40.*"
 gdb_test "record function-call-history /ci -" [multi_line \
   "1\tmain\tinst 1,1" \
   "2\t  fun4\tinst 2,4" \
-  "3\t    fun1\tinst 5,8\r" \
+  "3\t    fun1\tinst 5,8" \
   ] "function-call-history from 2 backwards"
 
 # check that we're filling up the context correctly
@@ -173,7 +173,7 @@ gdb_test "record function-call-history /ci" [multi_line \
 gdb_test "record instruction-history" [multi_line \
   "38.*" \
   "39.*" \
-  "40.*\r" \
+  "40.*" \
   ] "instruction-history from end forwards"
 
 # we should get the exact same history from the second to last instruction
@@ -183,12 +183,12 @@ gdb_test "record goto 39" ".*fun4 \\(\\) at record_goto.c:44.*"
 gdb_test "record function-call-history /ci" [multi_line \
   "14\t      fun2\tinst 35,36" \
   "15\t    fun3\tinst 37,38" \
-  "16\t  fun4\tinst 39,40\r" \
+  "16\t  fun4\tinst 39,40" \
   ] "function-call-history from 39 forwards"
 
 # check that we're filling up the context correctly
 gdb_test "record instruction-history" [multi_line \
   "38.*" \
   "39.*" \
-  "40.*\r" \
+  "40.*" \
   ] "instruction-history from 39 forwards"
index 050bd98cf56746961ed224f84b24efa6209112bf..01201ecd3964d1ecefab0f0ad1e076d787bdb9e0 100644 (file)
@@ -172,5 +172,5 @@ gdb_test "print foo(inc)"\
         "The type. 'incomplete .' isn't fully known to GDB.*"\
         "unsuccessful because declaration"
 gdb_test "print foo(ip)"\
-        "Cannot resolve function foo to any overloaded instance."\
+        "Cannot resolve function foo to any overloaded instance"\
         "unsuccessful because incorrect"
index 59dccfbb3bdfa4715c34e6cfe2f20ac98f807e3e..36a48e5637da0ce5b86938de68881f019ad1966d 100644 (file)
@@ -21,8 +21,8 @@
 # Test the help messages.
 
 proc test_help {} {
-    set first_component_help "Print the first class/namespace component of NAME"
-    set namespace_help "Deprecated placeholder for removed functionality."
+    set first_component_help "Print the first class/namespace component of NAME\\."
+    set namespace_help "Deprecated placeholder for removed functionality\\."
 
     test_prefix_command_help {"maintenance cplus"} {
         "C\\+\\+ maintenance commands\.\[\r\n\]+"
@@ -36,8 +36,8 @@ proc test_help {} {
 
     gdb_test "maint cp" $multiple_help_body
 
-    gdb_test "help maint cp first_component" "${first_component_help}."
-    gdb_test "help maint cp namespace" "${namespace_help}."
+    gdb_test "help maint cp first_component" "${first_component_help}"
+    gdb_test "help maint cp namespace" "${namespace_help}"
 }
 
 # This is used when NAME should contain only a single component.  Be
index 62e45f50d0eec54255099eeda3e678cd44be0342..fd8268a5791c3376d1f652a6ecda329671cd5a3e 100644 (file)
@@ -241,11 +241,11 @@ for {set idx 0} {$idx < [llength $overloads]} {incr idx} {
 }
 
 # Verify the breakpoints.
-set bptable "Num\[\t \]+Type\[\t \]+Disp Enb Address\[\t \]+What.*\[\r\n]+"
-append bptable "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep\[\t \]y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\[\r\n\]+"
-append bptable "\[\t \]+breakpoint already hit 1 time\[\r\n\]+."
+set bptable "Num\[\t \]+Type\[\t \]+Disp Enb Address\[\t \]+What\\s*\r\n"
+append bptable "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep\[\t \]y\[\t \]+$hex\[\t \]+in main(\\((|void)\\))? at.*$srcfile:49\r\n"
+append bptable "\[\t \]+breakpoint already hit 1 time"
 foreach ovld $overloads {
-    append bptable [format "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(%s\\) at.*$srcfile:%d\[\r\n\]+" $ovld \
+    append bptable [format "\r\n\[0-9\]+\[\t \]+breakpoint\[\t \]+keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(%s\\) at.*$srcfile:%d" $ovld \
                        $line($type_map("$ovld"))]
 }
 gdb_test "info break" $bptable "breakpoint info (after setting one-by-one)"
@@ -366,12 +366,12 @@ gdb_expect {
 }
 
 # Create the breakpoint table for "info breakpoint".
-set bptable "Num\[\t \]+Type\[\t \]+Disp Enb Address\[\t \]+What.*\[\r\n]+"
-append bptable "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep\[\t \]y\[\t \]+<MULTIPLE>.*\[\r\n\]+"
+set bptable "Num\[\t \]+Type\[\t \]+Disp Enb Address\[\t \]+What\\s*\r\n"
+append bptable "\[0-9\]+\[\t \]+breakpoint\[\t \]+keep\[\t \]y\[\t \]+<MULTIPLE>\\s*"
 foreach ovld {void char signed_char unsigned_char short_int \
                  unsigned_short_int int unsigned_int long_int \
                  unsigned_long_int float double} {
-  append bptable [format "\[0-9\]+.\[0-9\]+\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(%s\\) at.*$srcfile:%d\[\r\n\]+" \
+  append bptable [format "\r\n\[0-9\]+.\[0-9\]+\[\t \]+y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(%s\\) at.*$srcfile:%d" \
                      $types($ovld) $line($ovld)]
 }
 
index f04a441c54d858dfddbbe8e5cf83748955d7d5b4..ac453179da243c4fde99979b78ec058a68cfd0ad 100644 (file)
@@ -67,9 +67,9 @@ gdb_test "print one / two" "\\\$\[0-9\]* = {x = 0, y = 0}"
 
 gdb_test "print one % two" "\\\$\[0-9\]* = {x = 2, y = 3}"
 
-gdb_test "print one && two" "\\\$\[0-9\]* = 1\[\r\n\]"
+gdb_test "print one && two" "\\\$\[0-9\]* = 1"
 
-gdb_test "print one || two" "\\\$\[0-9\]* = 1\[\r\n\]"
+gdb_test "print one || two" "\\\$\[0-9\]* = 1"
 
 gdb_test "print one & two" "\\\$\[0-9\]* = {x = 0, y = 1}"
 
@@ -77,18 +77,18 @@ gdb_test "print one | two" "\\\$\[0-9\]* = {x = 6, y = 7}"
 
 gdb_test "print one ^ two" "\\\$\[0-9\]* = {x = 6, y = 6}"
 
-gdb_test "print one < two" "\\\$\[0-9\]* = 1\[\r\n\]"
+gdb_test "print one < two" "\\\$\[0-9\]* = 1"
 
-gdb_test "print one <= two" "\\\$\[0-9\]* = 1\[\r\n\]"
+gdb_test "print one <= two" "\\\$\[0-9\]* = 1"
 
-gdb_test "print one > two" "\\\$\[0-9\]* = 0\[\r\n\]"
+gdb_test "print one > two" "\\\$\[0-9\]* = 0"
 
-gdb_test "print one >= two" "\\\$\[0-9\]* = 0\[\r\n\]"
+gdb_test "print one >= two" "\\\$\[0-9\]* = 0"
 
-gdb_test "print one == two" "\\\$\[0-9\]* = 0\[\r\n\]"
-gdb_test "print one.operator== (two)" "\\\$\[0-9\]* = 0\[\r\n\]"
+gdb_test "print one == two" "\\\$\[0-9\]* = 0"
+gdb_test "print one.operator== (two)" "\\\$\[0-9\]* = 0"
 
-gdb_test "print one != two" "\\\$\[0-9\]* = 1\[\r\n\]"
+gdb_test "print one != two" "\\\$\[0-9\]* = 1"
 
 # Can't really check the output of this one without knowing
 # target integer width.  Make sure we don't try to call
@@ -98,7 +98,7 @@ gdb_test "print one << 31" "\\\$\[0-9\]* = {x = -?\[0-9\]*, y = -?\[0-9\]*}"
 # Should be fine even on < 32-bit targets.
 gdb_test "print one >> 31" "\\\$\[0-9\]* = {x = 0, y = 0}"
 
-gdb_test "print !one" "\\\$\[0-9\]* = 0\[\r\n\]"
+gdb_test "print !one" "\\\$\[0-9\]* = 0"
 
 # Assumes 2's complement.  So does everything...
 gdb_test "print +one" "\\\$\[0-9\]* = {x = 2, y = 3}"
index 445befddf285e3c03de06b121b562db2efc8c90a..908c969741b65740005ad7f956fd69114403cda0 100644 (file)
@@ -228,7 +228,7 @@ proc test_virtual_calls {} {
 proc make_one_vtable_result {name args} {
     global hex
 
-    set nls "\[\r\n\]+"
+    set nls "\r\n"
 
     set result "vtable for '${name}' @ $hex .subobject @ $hex.:$nls"
     set count 0
@@ -237,9 +237,20 @@ proc make_one_vtable_result {name args} {
        incr count
     }
 
+    # Remove the last instance of $nls.
+    if {$count > 0} {
+       set result [string range $result 0 end-[string length $nls]]
+    }
+
+    verbose -log "APB: result: '$result'"
+
     return $result
 }
 
+proc vtable_seq { args } {
+    return [join "\r\n\r\n" $args]
+}
+
 # Test "info vtbl".
 
 proc test_info_vtbl {} {
@@ -255,12 +266,12 @@ proc test_info_vtbl {} {
     set vt_D2 [make_one_vtable_result D "non-virtual thunk to E::vg" D::vd]
     set vt_E [make_one_vtable_result E E::f E::vg E::vv]
 
-    gdb_test "info vtbl a" "${vt_A}${vt_V}"
-    gdb_test "info vtbl b" "${vt_B}${vt_V}"
+    gdb_test "info vtbl a" [vtable_seq ${vt_A} ${vt_V}]
+    gdb_test "info vtbl b" [vtable_seq ${vt_B} ${vt_V}]
     gdb_test "info vtbl c" "${vt_V}"
-    gdb_test "info vtbl d" "${vt_D}${vt_V}"
-    gdb_test "info vtbl e" "${vt_E}${vt_D2}${vt_V2}"
-    gdb_test "info vtbl pEe" "${vt_E}${vt_D2}${vt_V2}"
+    gdb_test "info vtbl d" [vtable_seq ${vt_D} ${vt_V}]
+    gdb_test "info vtbl e" [vtable_seq ${vt_E} ${vt_D2} ${vt_V2}]
+    gdb_test "info vtbl pEe" [vtable_seq ${vt_E} ${vt_D2} ${vt_V2}]
 
     gdb_test "info vtbl" "Argument required.*"
     gdb_test "info vtbl va" \
index a9e656ddfc0df92f173e182f63f9ecb1eb2e5a33..baa80b4c37c5949735e8fc6dc5044fedf53a871b 100644 (file)
@@ -179,7 +179,7 @@ proc_with_prefix test_bkpt_cond_and_cmds { } {
     gdb_scm_test_silent_cmd "guile (define blist (breakpoints))" \
        "get breakpoint list 6"
     gdb_test "guile (print (breakpoint-commands (list-ref blist (- (length blist) 1))))" \
-       "print \"Command for breakpoint has been executed.\".*print result"
+       "print \"Command for breakpoint has been executed.\".*print result\r\n"
 }
 
 proc_with_prefix test_bkpt_invisible { } {
index 25a9780a4d5fb5fa87620efbf36eee032428b6b2..afcb17c20962c2dc18c12d132a604feaee099968 100644 (file)
@@ -93,7 +93,7 @@ gdb_test_multiline "input command to throw error" \
     "    (throw-user-error \"you lose! ~a\" arg))))" "" \
     "end" ""
 
-gdb_test "test-error-cmd ugh" "ERROR: you lose! ugh" "call error command"
+gdb_test "test-error-cmd ugh" "ERROR: you lose! ugh\r\n" "call error command"
 
 # Test string->argv.
 
index 4c1fb052b5cd3cf43ea85a1619435f9d0013ea46..9446ef5b6b474a821b37ca4e18ba8f5545e22de4 100644 (file)
@@ -74,7 +74,11 @@ proc break_info_1 {num args} {
        }
 
        #  Add function/source file info.
-       append result "in $func at .*$source${end}"
+       append result "in $func at .*$source"
+
+       if {$i < $locs} {
+           append result ${end}
+       }
     }
 
     return $result
index ab81b7ade8575e1935b2f9be367cfd88cf80425e..76094c95d107f9324ee67428b50b09a7d874d925 100644 (file)
@@ -57,7 +57,7 @@ proc_with_prefix test_bkpt_basic { } {
     gdb_test "python print (blist\[0\])" \
        "<gdb.Breakpoint object at $hex>" "Check obj exists @main"
     gdb_test "python print (blist\[0\].location)" \
-       "main." "Check breakpoint location @main"
+       "main" "Check breakpoint location @main"
     gdb_test "python print (blist\[0\].pending)" "False" \
        "Check pending status of main breakpoint"
 
@@ -75,7 +75,7 @@ proc_with_prefix test_bkpt_basic { } {
     gdb_test "python print (blist\[0\])" \
        "<gdb.Breakpoint object at $hex>" "Check obj exists @main 2"
     gdb_test "python print (blist\[0\].location)" \
-       "main." "Check breakpoint location @main 2"
+       "main" "Check breakpoint location @main 2"
     gdb_test "python print (blist\[1\])" \
        "<gdb.Breakpoint object at $hex>" "Check obj exists @mult_line"
 
@@ -206,7 +206,7 @@ proc_with_prefix test_bkpt_cond_and_cmds { } {
     gdb_py_test_silent_cmd "python last_bp = blist\[len(blist)-1\]" \
        "Find last breakpoint" 0
     gdb_test "python print (last_bp.commands)" \
-       "print \"Command for breakpoint has been executed.\".*print result"
+       "print \"Command for breakpoint has been executed.\".*print result\r\n"
 
     gdb_test_no_output "python last_bp.commands = 'echo hi\\necho there'" \
        "set commands"
index fd53806e467366ec98e665904d06915eb8084d96..5c9538075840b31b39b9655496ad9a41aba3be9c 100644 (file)
@@ -105,11 +105,11 @@ with_test_prefix "module global variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print aglobal" " = 0$newline"  "module global reverse-breakpoint"
+    gdb_test "print aglobal" " = 0"  "module global reverse-breakpoint"
     gdb_test "step"          " module global post-change .*"
-    gdb_test "print aglobal" " = 1$newline"  "module global forward past bp"
+    gdb_test "print aglobal" " = 1"  "module global forward past bp"
     gdb_test "reverse-step"  "$newline$breakloc.*"
-    gdb_test "print aglobal" " = 0$newline"  "module global reverse-step to bp"
+    gdb_test "print aglobal" " = 0"  "module global reverse-step to bp"
 }
 
 # Module static variable, reverse
@@ -120,11 +120,11 @@ with_test_prefix "module static variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print astatic" " = 0$newline"  "module static reverse-breakpoint"
+    gdb_test "print astatic" " = 0"  "module static reverse-breakpoint"
     gdb_test "step"          " module static post-change .*"
-    gdb_test "print astatic" " = 1$newline"  "module static forward"
+    gdb_test "print astatic" " = 1"  "module static forward"
     gdb_test "reverse-step"  "$newline$breakloc.*"
-    gdb_test "print astatic" " = 0$newline"  "module static reverse-step"
+    gdb_test "print astatic" " = 0"  "module static reverse-step"
 }
 
 # Function static variable, reverse
@@ -135,11 +135,11 @@ with_test_prefix "function static variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "function static reverse-breakpoint"
+    gdb_test "print a"      " = 0"  "function static reverse-breakpoint"
     gdb_test "step"         " function static post-change .*"
-    gdb_test "print a"      " = 1$newline"  "function static forward"
+    gdb_test "print a"      " = 1"  "function static forward"
     gdb_test "reverse-step" "$newline$breakloc.*"
-    gdb_test "print a"      " = 0$newline"  "function static reverse-step"
+    gdb_test "print a"      " = 0"  "function static reverse-step"
 }
 
 # Auto variable, reverse
@@ -150,11 +150,11 @@ with_test_prefix "auto variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "auto var reverse-breakpoint"
+    gdb_test "print a"      " = 0"  "auto var reverse-breakpoint"
     gdb_test "step"         " auto post-change .*"
-    gdb_test "print a"      " = 1$newline"  "auto var forward"
+    gdb_test "print a"      " = 1"  "auto var forward"
     gdb_test "reverse-step" "$newline$breakloc.*"
-    gdb_test "print a"      " = 0$newline"  "auto var reverse-step"
+    gdb_test "print a"      " = 0"  "auto var reverse-step"
 }
 
 # Register variable, reverse
@@ -165,12 +165,12 @@ with_test_prefix "register variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "register var reverse-breakpoint"
+    gdb_test "print a"      " = 0"  "register var reverse-breakpoint"
     gdb_test "step"         " register post-change .*"
-    gdb_test "print a"      " = 1$newline"  \
+    gdb_test "print a"      " = 1"  \
        "register var step post-change, first time"
     gdb_test "reverse-step" "$newline$breakloc.*"
-    gdb_test "print a"      " = 0$newline"  "register var reverse step-to"
+    gdb_test "print a"      " = 0"  "register var reverse step-to"
 }
 
 # Proceed to beginning of main
@@ -189,12 +189,12 @@ with_test_prefix "register variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "register var forward-breakpoint"
+    gdb_test "print a"      " = 0"  "register var forward-breakpoint"
     gdb_test "reverse-step" "hide.*"
     gdb_test "step"         "$newline$breakloc.*" "step, 1"
-    gdb_test "print a"      " = 0$newline"  "register var forward step-to"
+    gdb_test "print a"      " = 0"  "register var forward step-to"
     gdb_test "step"         " register post-change .*" "step, 2"
-    gdb_test "print a"      " = 1$newline" \
+    gdb_test "print a"      " = 1" \
        "register var step post-change, second time"
 }
 
@@ -206,12 +206,12 @@ with_test_prefix "auto variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "auto var forward-breakpoint"
+    gdb_test "print a"      " = 0"  "auto var forward-breakpoint"
     gdb_test "reverse-step" "hide.*"
     gdb_test "step"         "$newline$breakloc.*" "step, 1"
-    gdb_test "print a"      " = 0$newline"  "auto var forward step-to"
+    gdb_test "print a"      " = 0"  "auto var forward step-to"
     gdb_test "step"         " auto post-change .*" "step, 2"
-    gdb_test "print a"      " = 1$newline"  "auto var step post-change"
+    gdb_test "print a"      " = 1"  "auto var step post-change"
 }
 
 # Function static variable, forward
@@ -222,12 +222,12 @@ with_test_prefix "function static variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "function static forward-breakpoint"
+    gdb_test "print a"      " = 0"  "function static forward-breakpoint"
     gdb_test "reverse-step" "hide.*"
     gdb_test "step"         "$newline$breakloc.*" "step, 1"
-    gdb_test "print a"      " = 0$newline"  "function static forward step-to"
+    gdb_test "print a"      " = 0"  "function static forward step-to"
     gdb_test "step"         " function static post-change .*" "step, 2"
-    gdb_test "print a"      " = 1$newline"  "function static step post-change"
+    gdb_test "print a"      " = 1"  "function static step post-change"
 }
 
 # Module static variable, forward
@@ -238,12 +238,12 @@ with_test_prefix "module static variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print astatic" " = 0$newline"  "module static forward-breakpoint"
+    gdb_test "print astatic" " = 0"  "module static forward-breakpoint"
     gdb_test "reverse-step"  "hide.*"
     gdb_test "step"          "$newline$breakloc.*" "step, 1"
-    gdb_test "print astatic" " = 0$newline"  "module static forward step-to"
+    gdb_test "print astatic" " = 0"  "module static forward step-to"
     gdb_test "step"          " module static post-change .*" "step, 2"
-    gdb_test "print astatic" " = 1$newline"  "module static step post-change"
+    gdb_test "print astatic" " = 1"  "module static step post-change"
 }
 
 # Module global variable, forward
@@ -254,11 +254,11 @@ with_test_prefix "module global variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print aglobal" " = 0$newline"  "module global forward-breakpoint"
+    gdb_test "print aglobal" " = 0"  "module global forward-breakpoint"
     gdb_test "reverse-step"  "hide.*"
     gdb_test "step"          "$newline$breakloc.*" "step, 1"
-    gdb_test "print aglobal" " = 0$newline"  "module global forward step-to"
+    gdb_test "print aglobal" " = 0"  "module global forward step-to"
     gdb_test "step"          " module global post-change .*" "step, 2"
-    gdb_test "print aglobal" " = 1$newline"  "module global step post-change"
+    gdb_test "print aglobal" " = 1"  "module global step post-change"
 }
 
index 68412b47d3bd0bf725460ada5a8d169b7def427a..60d8f33a0226da9e440abef77f206365f1c418e3 100644 (file)
@@ -80,11 +80,11 @@ with_test_prefix "module global variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print aglobal" " = 0$newline"  "module global reverse-breakpoint"
+    gdb_test "print aglobal" " = 0"  "module global reverse-breakpoint"
     gdb_test "step"          " module global post-change .*"
-    gdb_test "print aglobal" " = 1$newline"  "module global forward past bp"
+    gdb_test "print aglobal" " = 1"  "module global forward past bp"
     gdb_test "reverse-step"  "$newline$breakloc.*"
-    gdb_test "print aglobal" " = 0$newline"  "module global reverse-step to bp"
+    gdb_test "print aglobal" " = 0"  "module global reverse-step to bp"
 }
 
 # Module static variable, reverse
@@ -95,11 +95,11 @@ with_test_prefix "module static variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print astatic" " = 0$newline"  "module static reverse-breakpoint"
+    gdb_test "print astatic" " = 0"  "module static reverse-breakpoint"
     gdb_test "step"          " module static post-change .*"
-    gdb_test "print astatic" " = 1$newline"  "module static forward"
+    gdb_test "print astatic" " = 1"  "module static forward"
     gdb_test "reverse-step"  "$newline$breakloc.*"
-    gdb_test "print astatic" " = 0$newline"  "module static reverse-step"
+    gdb_test "print astatic" " = 0"  "module static reverse-step"
 }
 
 # Function static variable, reverse
@@ -110,11 +110,11 @@ with_test_prefix "function static variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "function static reverse-breakpoint"
+    gdb_test "print a"      " = 0"  "function static reverse-breakpoint"
     gdb_test "step"         " function static post-change .*"
-    gdb_test "print a"      " = 1$newline"  "function static forward"
+    gdb_test "print a"      " = 1"  "function static forward"
     gdb_test "reverse-step" "$newline$breakloc.*"
-    gdb_test "print a"      " = 0$newline"  "function static reverse-step"
+    gdb_test "print a"      " = 0"  "function static reverse-step"
 }
 
 # Auto variable, reverse
@@ -125,11 +125,11 @@ with_test_prefix "auto variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "auto var reverse-breakpoint"
+    gdb_test "print a"      " = 0"  "auto var reverse-breakpoint"
     gdb_test "step"         " auto post-change .*"
-    gdb_test "print a"      " = 1$newline"  "auto var forward"
+    gdb_test "print a"      " = 1"  "auto var forward"
     gdb_test "reverse-step" "$newline$breakloc.*"
-    gdb_test "print a"      " = 0$newline"  "auto var reverse-step"
+    gdb_test "print a"      " = 0"  "auto var reverse-step"
 }
 
 # Register variable, reverse
@@ -140,11 +140,11 @@ with_test_prefix "register variable, reverse" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "reverse-continue" "$srcfile:$breakloc.*" "reverse to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "register var reverse-breakpoint"
+    gdb_test "print a"      " = 0"  "register var reverse-breakpoint"
     gdb_test "step"         " register post-change .*"
-    gdb_test "print a"      " = 1$newline"  "register var step post-change"
+    gdb_test "print a"      " = 1"  "register var step post-change"
     gdb_test "reverse-step" "$newline$breakloc.*"
-    gdb_test "print a"      " = 0$newline" \
+    gdb_test "print a"      " = 0" \
        "register var reverse step-to, first time"
 }
 
@@ -164,12 +164,12 @@ with_test_prefix "register variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "register var forward-breakpoint"
+    gdb_test "print a"      " = 0"  "register var forward-breakpoint"
     gdb_test "reverse-step" "hide.*"
     gdb_test "step"         "$newline$breakloc.*" "step, 1"
-    gdb_test "print a"      " = 0$newline"  "register var forward step-to"
+    gdb_test "print a"      " = 0"  "register var forward step-to"
     gdb_test "step"         " register post-change .*" "step, 2"
-    gdb_test "print a"      " = 1$newline" \
+    gdb_test "print a"      " = 1" \
        "register var step post-change, second time"
 }
 
@@ -181,12 +181,12 @@ with_test_prefix "auto variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "auto var forward-breakpoint"
+    gdb_test "print a"      " = 0"  "auto var forward-breakpoint"
     gdb_test "reverse-step" "hide.*"
     gdb_test "step"         "$newline$breakloc.*" "step, 1"
-    gdb_test "print a"      " = 0$newline"  "auto var forward step-to"
+    gdb_test "print a"      " = 0"  "auto var forward step-to"
     gdb_test "step"         " auto post-change .*" "step, 2"
-    gdb_test "print a"      " = 1$newline"  "auto var step post-change"
+    gdb_test "print a"      " = 1"  "auto var step post-change"
 }
 
 # Function static variable, forward
@@ -197,12 +197,12 @@ with_test_prefix "function static variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print a"      " = 0$newline"  "function static forward-breakpoint"
+    gdb_test "print a"      " = 0"  "function static forward-breakpoint"
     gdb_test "reverse-step" "hide.*"
     gdb_test "step"         "$newline$breakloc.*" "step, 1"
-    gdb_test "print a"      " = 0$newline"  "function static forward step-to"
+    gdb_test "print a"      " = 0"  "function static forward step-to"
     gdb_test "step"         " function static post-change .*" "step, 2"
-    gdb_test "print a"      " = 1$newline"  "function static step post-change"
+    gdb_test "print a"      " = 1"  "function static step post-change"
 }
 
 # Module static variable, forward
@@ -213,12 +213,12 @@ with_test_prefix "module static variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print astatic" " = 0$newline"  "module static forward-breakpoint"
+    gdb_test "print astatic" " = 0"  "module static forward-breakpoint"
     gdb_test "reverse-step"  "hide.*"
     gdb_test "step"          "$newline$breakloc.*" "step, 1"
-    gdb_test "print astatic" " = 0$newline"  "module static forward step-to"
+    gdb_test "print astatic" " = 0"  "module static forward step-to"
     gdb_test "step"          " module static post-change .*" "step, 2"
-    gdb_test "print astatic" " = 1$newline"  "module static step post-change"
+    gdb_test "print astatic" " = 1"  "module static step post-change"
 }
 
 # Module global variable, forward
@@ -229,10 +229,10 @@ with_test_prefix "module global variable, forward" {
     gdb_test "tbreak $breakloc" "$srcfile, line $breakloc.*"
     gdb_test "continue"         "$srcfile:$breakloc.*" "forward to $breakloc"
 
-    gdb_test "print aglobal" " = 0$newline"  "module global forward-breakpoint"
+    gdb_test "print aglobal" " = 0"  "module global forward-breakpoint"
     gdb_test "reverse-step"  "hide.*"
     gdb_test "step"          "$newline$breakloc.*" "step, 1"
-    gdb_test "print aglobal" " = 0$newline"  "module global forward step-to"
+    gdb_test "print aglobal" " = 0"  "module global forward step-to"
     gdb_test "step"          " module global post-change .*" "step, 2"
-    gdb_test "print aglobal" " = 1$newline"  "module global step post-change"
+    gdb_test "print aglobal" " = 1"  "module global step post-change"
 }
index e7ee9385919e630c8a4a1634d8f4ec593eb12789..a6e6ff860462ac15635c091ae26c00da6f05f5ee 100644 (file)
@@ -40,14 +40,14 @@ set eol "\[ \t\]*\[\n\r\]+"
 gdb_test "ptype v1" "type = struct a {$eol
     int x;$eol
     int y;$eol
-}$eol"
+}"
 
 if {[test_debug_format "stabs"]} {
     setup_kfail "gdb/1602" *-*-*
 }
 gdb_test "ptype v2" "type = struct a {$eol
     const char .c;$eol
-}$eol"
+}"
 
 if {[test_debug_format "stabs"]} {
     setup_kfail "gdb/1603" *-*-*
index 0186a38fed9c34f901106e2beca9c1a4307c7fe9..73bea594e158cf178ec308cbac491e43980d6696 100644 (file)
@@ -60,7 +60,7 @@ proc do_test { fork_func follow target-non-stop non-stop displaced-stepping } {
     # Verify that the catchpoint is mentioned in an "info breakpoints",
     # and further that the catchpoint mentions no process id.
     gdb_test "info breakpoints" \
-       ".*catchpoint.*keep y.*fork\[\r\n\]+" \
+       ".*catchpoint.*keep y.*fork" \
        "info breakpoints before fork"
 
     gdb_test "continue" \
index 97d67b7a217e17f68365d4e53d43bd66be00a86b..d606e19deb14b1d1c92c299e9dc185906f913199 100644 (file)
@@ -51,7 +51,7 @@ clean_restart ${testfile}
 set horiz "\[^\n\r\]*"
 
 # regexp for newline
-set nl "\[\r\n\]+"
+set nl "\r\n"
 
 set timeout 30
 
@@ -138,7 +138,7 @@ proc load_core { filename } {
 
     # The thread2 thread should be marked as the current thread.
 
-    gdb_test "info threads" "\\* ${horiz} thread2 .*${nl}" \
+    gdb_test "info threads" "\\* ${horiz} thread2 .*" \
            "thread2 is current thread in corefile"
 }
 
index ffc3250577f182954f197188f1b3250c63a70b42..2a2158886d8dd2711b9c7c41434810e708c8743b 100644 (file)
@@ -71,48 +71,51 @@ gdb_trace_setactions "5.1b: set actions for first tracepoint" \
        "collect gdb_char_test" "^$"
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_char_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
-               "5.1c: verify actions set for first tracepoint"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_char_test" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target"] \
+    "5.1c: verify actions set for first tracepoint"
 
 gdb_trace_setactions "5.1d: set actions for second tracepoint" \
        "$trcpt2" \
        "collect gdb_short_test" "^$"
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_char_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_short_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
-               "5.1e: verify actions set for second tracepoint"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_char_test" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_short_test" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target"] \
+    "5.1e: verify actions set for second tracepoint"
 
 gdb_trace_setactions "5.2a: set actions for last (default) tracepoint" \
        "" \
        "collect gdb_long_test" "^$"
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_char_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_short_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_long_test.
-\[\t \]+not installed on target." \
-               "5.2b: verify actions set for second tracepoint"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_char_test" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_short_test" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_long_test" \
+        "\[\t \]+not installed on target"] \
+    "5.2b: verify actions set for second tracepoint"
 
 # 5.3 replace actions set earlier
 
@@ -121,17 +124,18 @@ gdb_trace_setactions "5.3a: reset actions for first tracepoint" \
        "collect gdb_struct1_test" "^$"
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_struct1_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_short_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_long_test.
-\[\t \]+not installed on target." \
-               "5.3b: verify actions set for first tracepoint"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_struct1_test" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_short_test" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_long_test" \
+        "\[\t \]+not installed on target"] \
+    "5.3b: verify actions set for first tracepoint"
 
 #
 # test end command (all by itself)
@@ -217,17 +221,18 @@ gdb_trace_setactions "5.10a: set teval action for second tracepoint" \
        "teval \$tsv += 1" "^$"
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+teval gdb_char_test.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+teval \\\$tsv \\\+= 1.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+collect gdb_long_test.
-\[\t \]+not installed on target." \
-               "5.10a: verify teval actions set for two tracepoints"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+teval gdb_char_test" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+teval \\\$tsv \\\+= 1" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+collect gdb_long_test" \
+        "\[\t \]+not installed on target"] \
+    "5.10a: verify teval actions set for two tracepoints"
 
 # Load the binary to the target too.
 gdb_load $binfile
index a849d96f432a752b33181b6b0284fb2547c35b3d..2142dc99f503e667707d4a8ffa12c0d3ef1b49b8 100644 (file)
@@ -50,14 +50,15 @@ gdb_test "trace gdb_asm_test" "Tracepoint \[0-9\]+ at .*" "set tracepoint 2"
 gdb_test "trace $testline1"   "Tracepoint \[0-9\]+ at .*" "set tracepoint 3"
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
-                       "3.1a: set three tracepoints"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target"] \
+    "3.1a: set three tracepoints"
 
 gdb_test "delete tracepoints" \
     "" \
@@ -77,14 +78,15 @@ if {$trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0} {
 }
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
-                       "3.2a: set three tracepoints"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target"] \
+    "3.2a: set three tracepoints"
 
 #gdb_test_no_output "delete tracepoint $trcpt1" ""
 gdb_test_multiple "delete tracepoint $trcpt1" "3.2b: delete first tracepoint" {
@@ -100,12 +102,13 @@ gdb_test_multiple "delete tracepoint $trcpt1" "3.2b: delete first tracepoint" {
 }
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
-                       "3.2c: verify delete first tracepoint"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target"] \
+    "3.2c: verify delete first tracepoint"
 
 #gdb_test_no_output "delete tracepoint $trcpt2" ""
 gdb_test_multiple "delete tracepoint $trcpt2" "3.2d: delete second tracepoint" {
@@ -121,10 +124,11 @@ gdb_test_multiple "delete tracepoint $trcpt2" "3.2d: delete second tracepoint" {
 }
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
-                       "3.2e: verify delete second tracepoint"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target"] \
+    "3.2e: verify delete second tracepoint"
 
 #gdb_test_no_output "delete tracepoint $trcpt3" ""
 gdb_test_multiple "delete tracepoint $trcpt3" "3.2f: delete third tracepoint" {
@@ -155,14 +159,15 @@ if {$trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0} {
 }
 
 gdb_test "info tracepoints" \
-    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target.
-\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
-                       "3.3a: set three tracepoints"
+    [multi_line \
+        "Num     Type\[ \]+Disp Enb Address\[ \]+What\\s*" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target" \
+        "\[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \
+        "\[\t \]+not installed on target"] \
+    "3.3a: set three tracepoints"
 
 #gdb_test_no_output "delete tracepoint $trcpt1 $trcpt2 $trcpt3" ""
 gdb_test_multiple "delete tracepoint $trcpt1 $trcpt2 $trcpt3" \
index 83660bed7a5c494b0ccbc2c9a6d0335b62955b51..97ef66b8df2a14762738500f491b7791f6863d08 100644 (file)
@@ -49,20 +49,20 @@ gdb_test "info tracepoints" \
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
 \[\t \]+not installed on target.
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
     "2.1: info tracepoints (all)"
 
 # 2.2 info tracepoint (specific)
 gdb_test "info tracepoint $c_test_num" \
     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
     "2.2a: info tracepoint $c_test_num (gdb_c_test)"
 
 gdb_test "info tracepoint $asm_test_num" \
     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
     "2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
 
 # 2.3 info tracepoint (invalid tracepoint number)
index f2b70c3f3ade58ec9d2654604a8408ab8f6f0881..e09849303f3e4b4d85bc30b481e753d823d4681e 100644 (file)
@@ -60,7 +60,7 @@ gdb_test "info tracepoints" \
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
 \[\t \]+not installed on target.
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
                        "4.1a: set three tracepoints, passcounts all zero"
 
 gdb_test "passcount 2 $trcpt1" \
@@ -75,7 +75,7 @@ gdb_test "info tracepoints" \
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+.
 \[\t \]+not installed on target.
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
        "4.1c: verify 1st tracepoint's passcount set to two"
 
 gdb_test "passcount 4 $trcpt2" \
@@ -91,7 +91,7 @@ gdb_test "info tracepoints" \
 \[\t \]+pass count 4 .
 \[\t \]+not installed on target.
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
        "4.1c: verify 2nd tracepoint's passcount set to four"
 
 # 4.2 passcount of last (default) tracepoint
@@ -191,7 +191,7 @@ gdb_test "info tracepoints" \
 \[\t \]+not installed on target.
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+.
 \[\t \]+pass count 4 .
-\[\t \]+not installed on target."  \
+\[\t \]+not installed on target"  \
        "4.6: verify passcount to zero"
 
 # 4.7 (test a very large passcount)
index 3fed8dad2ec61ad3bbc31d1060aa5609476a09a5..9d0310188f2476e0c75d81771a75f45b832fa306 100644 (file)
@@ -58,7 +58,7 @@ gdb_test "trace $srcfile:$testline2" \
        "Tracepoint $decimal at $hex: file.*$srcfile, line $testline2." \
        "1.1a: set tracepoint at sourceline"
 gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
        "1.1b: trace sourcefile:line"
 
 # 1.2 trace invalid source line
@@ -82,7 +82,7 @@ gdb_test "trace gdb_recursion_test" \
        "Tracepoint $decimal at $hex: file.*$srcfile, line $testline1." \
        "1.4a: trace function by name"
 gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
        "1.4b: trace function by name"
 
 # 1.5 trace non-existant function
@@ -120,7 +120,7 @@ gdb_test "trace \*gdb_recursion_test" \
        "Tracepoint $decimal at .*$c_test_addr.*" \
        "1.7a: trace at function label (before prologue)"
 gdb_test "info trace" "$c_test_addr.*in gdb_recursion_test.*:$baseline.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
        "1.7b: verify trace at specific address"
 
 # 1.8 trace at invalid address
@@ -139,7 +139,7 @@ gdb_test "trace gdb_recursion_test if q1 > 0" \
        "1.11a: conditional tracepoint"
 gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1.
 \[\t \]+trace only if q1 > 0.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
        "1.11b: verify conditional tracepoint"
 
 # 1.12 set tracepoint in prologue
index 995b5a083a414b16f299a5b4e0cdfc8184182e12..21cc2ee8298fc73fd8db52570f63d0e1c3f95b62 100644 (file)
@@ -44,7 +44,7 @@ if {$trcpt1 <= 0} {
 gdb_test "info tracepoints" \
     "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+tracepoint     keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+.
-\[\t \]+not installed on target." \
+\[\t \]+not installed on target" \
        "5.12: set a tracepoint, stepcount is zero"
 
 set stepcount 12
index 5dc79452a4b34d838166bcaf802d45973076563f..5fd084bf54ac8de913b7d337f16e2d575ab80ad8 100644 (file)
@@ -1454,13 +1454,13 @@ proc gdb_test { args } {
     }
 
     set prompt [fill_in_default_prompt $prompt [expr !${no-prompt-anchor}]]
-    set nl [expr ${nonl} ? {""} : {"\[\r\n\]+"}]
+    set nl [expr ${nonl} ? {""} : {"\r\n"}]
 
     set saw_question 0
 
     set user_code {}
     lappend user_code {
-       -re "\[\r\n\]*(?:$pattern)$nl$prompt" {
+       -re "(?:$pattern)$nl$prompt" {
            if { $question != "" & !$saw_question} {
                fail $message
            } elseif {!$nopass} {