| OLD | NEW |
| 1 # Copyright 1998, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 1998, 2007-2012 Free Software Foundation, Inc. |
| 2 # | 2 # |
| 3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
| 4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
| 5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. | 6 # (at your option) any later version. |
| 7 # | 7 # |
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
| 12 # | 12 # |
| 13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
| 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 |
| 16 # This file was written by Michael Snyder (msnyder@cygnus.com) | 16 # This file was written by Michael Snyder (msnyder@cygnus.com) |
| 17 | 17 |
| 18 load_lib "trace-support.exp"; | 18 load_lib "trace-support.exp"; |
| 19 | 19 |
| 20 if $tracelevel then { | |
| 21 strace $tracelevel | |
| 22 } | |
| 23 | |
| 24 | 20 |
| 25 gdb_exit | 21 gdb_exit |
| 26 gdb_start | 22 gdb_start |
| 27 | 23 |
| 28 set testfile "actions" | 24 standard_testfile actions.c |
| 29 set srcfile ${testfile}.c | |
| 30 set binfile $objdir/$subdir/save-trace | |
| 31 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ | 25 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ |
| 32 executable {debug nowarnings}] != "" } { | 26 executable {debug nowarnings}] != "" } { |
| 33 untested save-trace.exp | 27 untested save-trace.exp |
| 34 return -1 | 28 return -1 |
| 35 } | 29 } |
| 36 gdb_reinitialize_dir $srcdir/$subdir | 30 gdb_reinitialize_dir $srcdir/$subdir |
| 37 | 31 |
| 38 # If testing on a remote host, download the source file. | 32 # If testing on a remote host, download the source file. |
| 39 # remote_download host $srcdir/$subdir/$srcfile | 33 # remote_download host $srcdir/$subdir/$srcfile |
| 40 | 34 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 gdb_test_no_output "set default-collect" "10.2: clear default-collect" | 127 gdb_test_no_output "set default-collect" "10.2: clear default-collect" |
| 134 gdb_test "info tracepoints" "No tracepoints." "10.2: delete tracepoints" | 128 gdb_test "info tracepoints" "No tracepoints." "10.2: delete tracepoints" |
| 135 gdb_test "source savetrace.tr" \ | 129 gdb_test "source savetrace.tr" \ |
| 136 "Tracepoint \[0-9\]+ at .*" \ | 130 "Tracepoint \[0-9\]+ at .*" \ |
| 137 "10.2: read back saved tracepoints" | 131 "10.2: read back saved tracepoints" |
| 138 gdb_verify_tracepoints "10.2: verify recovered tracepoints"; | 132 gdb_verify_tracepoints "10.2: verify recovered tracepoints"; |
| 139 remote_file host delete savetrace.tr | 133 remote_file host delete savetrace.tr |
| 140 | 134 |
| 141 # 10.3 repeat with a path to the file | 135 # 10.3 repeat with a path to the file |
| 142 | 136 |
| 143 set escapedfilename [string_to_regexp $objdir/savetrace.tr] | 137 set trace_file_name [standard_output_file savetrace.tr] |
| 144 remote_file host delete $objdir/savetrace.tr | 138 set escapedfilename [string_to_regexp $trace_file_name] |
| 145 gdb_test "save-tracepoints $objdir/savetrace.tr" \ | 139 remote_file host delete $trace_file_name |
| 140 gdb_test "save-tracepoints $trace_file_name" \ |
| 146 "Saved to file '${escapedfilename}'." \ | 141 "Saved to file '${escapedfilename}'." \ |
| 147 "10.3: save tracepoint definitions, full path" | 142 "10.3: save tracepoint definitions, full path" |
| 148 | 143 |
| 149 gdb_delete_tracepoints | 144 gdb_delete_tracepoints |
| 150 gdb_test_no_output "set default-collect" "10.3: clear default-collect" | 145 gdb_test_no_output "set default-collect" "10.3: clear default-collect" |
| 151 gdb_test "info tracepoints" "No tracepoints." "10.3: delete tracepoints" | 146 gdb_test "info tracepoints" "No tracepoints." "10.3: delete tracepoints" |
| 152 gdb_test "source $objdir/savetrace.tr" \ | 147 gdb_test "source $trace_file_name" \ |
| 153 "Tracepoint \[0-9\]+ at .*" \ | 148 "Tracepoint \[0-9\]+ at .*" \ |
| 154 "10.4: read saved tracepoints, full path" | 149 "10.4: read saved tracepoints, full path" |
| 155 gdb_verify_tracepoints "10.3: verify recovered tracepoints, full path"; | 150 gdb_verify_tracepoints "10.3: verify recovered tracepoints, full path"; |
| 156 remote_file host delete $objdir/savetrace.tr | 151 remote_file host delete $trace_file_name |
| 157 | 152 |
| 158 # 10.5 invalid filename | 153 # 10.5 invalid filename |
| 159 # [deferred -- not sure what a good invalid filename would be] | 154 # [deferred -- not sure what a good invalid filename would be] |
| 160 | 155 |
| 161 # 10.6 save-trace (file already exists) | 156 # 10.6 save-trace (file already exists) |
| 162 # [expect it to clobber the old one] | 157 # [expect it to clobber the old one] |
| 163 | 158 |
| 164 # 10.7 help save-tracepoints | 159 # 10.7 help save-tracepoints |
| 165 | 160 |
| 166 gdb_test "help save-tracepoints" \ | 161 gdb_test "help save-tracepoints" \ |
| 167 "Save current tracepoint definitions as a script.*" \ | 162 "Save current tracepoint definitions as a script.*" \ |
| 168 "10.7: help save-tracepoints" | 163 "10.7: help save-tracepoints" |
| OLD | NEW |