gdb/testsuite: change newline patterns used in gdb_test
[binutils-gdb.git] / gdb / testsuite / gdb.trace / tracecmd.exp
index c3c723105f40bd2d392677ae4d083a4b13d67fea..9d0310188f2476e0c75d81771a75f45b832fa306 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright 1998-2014 Free Software Foundation, Inc.
+#   Copyright 1998-2023 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
 
 load_lib "trace-support.exp"
 
-
-gdb_exit
-gdb_start
 standard_testfile actions.c
+require gdb_trace_common_supports_arch
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
          executable {debug nowarnings}] != "" } {
-    untested tracecmd.exp
+    untested "failed to compile"
     return -1
 }
-gdb_reinitialize_dir $srcdir/$subdir
-
-# If testing on a remote host, download the source file.
-# remote_download host $srcdir/$subdir/$srcfile
 
+clean_restart
 gdb_file_cmd $binfile
 
 # define relative source line numbers:
 # all subsequent line numbers are relative to this first one (baseline)
 set baseline  [gdb_find_recursion_test_baseline $srcfile]
-if { $baseline == -1 } then {
-    fail "Could not find gdb_recursion_test function"
+if {$baseline == -1} {
+    fail "could not find gdb_recursion_test function"
     return
 }
 
@@ -51,7 +46,7 @@ set testline2 [expr $baseline + 3]
 set helpcnt 0
 test_class_help "tracepoints" {
     "Tracing of program execution without stopping the program\.[\r\n\]+" 
-} "1.0: help tracepoints"
+} {} "1.0: help tracepoints"
 
 #
 # test trace command:
@@ -63,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
@@ -87,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
@@ -125,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
@@ -144,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
@@ -161,11 +156,11 @@ gdb_test "help trace" "Set a tracepoint at .*" "1.14: help trace"
 gdb_delete_tracepoints
 
 # Acceptance vs rejection of a location are target-specific, so allow both.
-gdb_test_multiple "ftrace gdb_recursion_test" "Set a fast tracepoint" {
+gdb_test_multiple "ftrace gdb_recursion_test" "set a fast tracepoint" {
     -re "Fast tracepoint $decimal at $hex: file.*$srcfile, line $testline1.*$gdb_prompt $" {
-       pass "Set a fast tracepoint"
+       pass "set a fast tracepoint"
     }
     -re ".*May not have a fast tracepoint at $hex.*$gdb_prompt $" {
-       pass "Declined to set a fast tracepoint"
+       pass "declined to set a fast tracepoint"
     }
 }