| OLD | NEW |
| 1 # Copyright 2011-2012 Free Software Foundation, Inc. | 1 # Copyright 2011-2012 Free Software Foundation, Inc. |
| 2 # This program is free software; you can redistribute it and/or modify | 2 # This program is free software; you can redistribute it and/or modify |
| 3 # it under the terms of the GNU General Public License as published by | 3 # it under the terms of the GNU General Public License as published by |
| 4 # the Free Software Foundation; either version 3 of the License, or | 4 # the Free Software Foundation; either version 3 of the License, or |
| 5 # (at your option) any later version. | 5 # (at your option) any later version. |
| 6 # | 6 # |
| 7 # This program is distributed in the hope that it will be useful, | 7 # This program is distributed in the hope that it will be useful, |
| 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 # GNU General Public License for more details. | 10 # GNU General Public License for more details. |
| 11 # | 11 # |
| 12 # You should have received a copy of the GNU General Public License | 12 # You should have received a copy of the GNU General Public License |
| 13 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 13 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 14 | 14 |
| 15 load_lib "trace-support.exp"; | 15 load_lib "trace-support.exp"; |
| 16 | 16 |
| 17 set testfile "trace-break" | 17 standard_testfile |
| 18 set executable $testfile | 18 set executable $testfile |
| 19 set srcfile $testfile.c | |
| 20 set binfile $objdir/$subdir/$testfile | |
| 21 set expfile $testfile.exp | 19 set expfile $testfile.exp |
| 22 | 20 |
| 23 # Some targets have leading underscores on assembly symbols. | 21 # Some targets have leading underscores on assembly symbols. |
| 24 set additional_flags [gdb_target_symbol_prefix_flags] | 22 set additional_flags [gdb_target_symbol_prefix_flags] |
| 25 | 23 |
| 26 if [prepare_for_testing $expfile $executable $srcfile \ | 24 if [prepare_for_testing $expfile $executable $srcfile \ |
| 27 [list debug $additional_flags]] { | 25 [list debug $additional_flags]] { |
| 28 untested "failed to prepare for trace tests" | 26 untested "failed to prepare for trace tests" |
| 29 return -1 | 27 return -1 |
| 30 } | 28 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 48 set spreg "rsp" | 46 set spreg "rsp" |
| 49 set pcreg "rip" | 47 set pcreg "rip" |
| 50 } elseif [is_x86_like_target] { | 48 } elseif [is_x86_like_target] { |
| 51 set fpreg "ebp" | 49 set fpreg "ebp" |
| 52 set spreg "esp" | 50 set spreg "esp" |
| 53 set pcreg "eip" | 51 set pcreg "eip" |
| 54 } | 52 } |
| 55 | 53 |
| 56 # Set breakpoint and tracepoint at the same address. | 54 # Set breakpoint and tracepoint at the same address. |
| 57 | 55 |
| 58 proc break_trace_same_addr_1 { trace_type option } { | 56 proc break_trace_same_addr_1 { trace_type option } \ |
| 57 { with_test_prefix "1 $trace_type $option" \ |
| 58 { |
| 59 global executable | 59 global executable |
| 60 global pf_prefix | |
| 61 global hex | 60 global hex |
| 62 | 61 |
| 63 set old_pf_prefix $pf_prefix | |
| 64 set pf_prefix "$pf_prefix 1 $trace_type $option:" | |
| 65 | |
| 66 # Start with a fresh gdb. | 62 # Start with a fresh gdb. |
| 67 clean_restart ${executable} | 63 clean_restart ${executable} |
| 68 if ![runto_main] { | 64 if ![runto_main] { |
| 69 fail "Can't run to main" | 65 fail "Can't run to main" |
| 70 set pf_prefix $old_pf_prefix | |
| 71 return -1 | 66 return -1 |
| 72 } | 67 } |
| 73 | 68 |
| 74 gdb_test_no_output "set breakpoint always-inserted ${option}" | 69 gdb_test_no_output "set breakpoint always-inserted ${option}" |
| 75 | 70 |
| 76 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" | 71 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" |
| 77 | 72 |
| 78 gdb_test "break set_point" "Breakpoint \[0-9\] at $hex: file.*" | 73 gdb_test "break set_point" "Breakpoint \[0-9\] at $hex: file.*" |
| 79 gdb_test "${trace_type} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: f
ile.*" | 74 gdb_test "${trace_type} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: f
ile.*" |
| 80 | 75 |
| 81 gdb_test_no_output "tstart" | 76 gdb_test_no_output "tstart" |
| 82 | 77 |
| 83 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to set_p
oint" | 78 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to set_p
oint" |
| 84 | 79 |
| 85 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end" | 80 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end" |
| 86 gdb_test_no_output "tstop" | 81 gdb_test_no_output "tstop" |
| 87 | 82 |
| 88 gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0" | 83 gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0" |
| 89 gdb_test "tfind" "Target failed to find requested trace frame\\..*" | 84 gdb_test "tfind" "Target failed to find requested trace frame\\..*" |
| 90 | 85 }} |
| 91 set pf_prefix $old_pf_prefix | |
| 92 } | |
| 93 | 86 |
| 94 # Set multiple tracepoints at the same address. | 87 # Set multiple tracepoints at the same address. |
| 95 | 88 |
| 96 proc break_trace_same_addr_2 { trace_type1 trace_type2 option } { | 89 proc break_trace_same_addr_2 { trace_type1 trace_type2 option } \ |
| 90 { with_test_prefix "2 $trace_type1 $trace_type2 $option" \ |
| 91 { |
| 97 global executable | 92 global executable |
| 98 global pf_prefix | |
| 99 global hex | 93 global hex |
| 100 | 94 |
| 101 set old_pf_prefix $pf_prefix | |
| 102 set pf_prefix "$pf_prefix 2 $trace_type1 $trace_type2 $option:" | |
| 103 | |
| 104 # Start with a fresh gdb. | 95 # Start with a fresh gdb. |
| 105 clean_restart ${executable} | 96 clean_restart ${executable} |
| 106 if ![runto_main] { | 97 if ![runto_main] { |
| 107 fail "Can't run to main" | 98 fail "Can't run to main" |
| 108 set pf_prefix $old_pf_prefix | |
| 109 return -1 | 99 return -1 |
| 110 } | 100 } |
| 111 | 101 |
| 112 gdb_test_no_output "set breakpoint always-inserted ${option}" | 102 gdb_test_no_output "set breakpoint always-inserted ${option}" |
| 113 | 103 |
| 114 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" | 104 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" |
| 115 | 105 |
| 116 gdb_test "${trace_type1} set_point" \ | 106 gdb_test "${trace_type1} set_point" \ |
| 117 "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \ | 107 "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \ |
| 118 "${trace_type1} set_point (1)" | 108 "${trace_type1} set_point (1)" |
| 119 | 109 |
| 120 gdb_test "${trace_type2} set_point" \ | 110 gdb_test "${trace_type2} set_point" \ |
| 121 "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \ | 111 "\(Fast t|T\)racepoint \[0-9\] at $hex: file.*" \ |
| 122 "${trace_type2} set_point (2)" | 112 "${trace_type2} set_point (2)" |
| 123 | 113 |
| 124 gdb_test_no_output "tstart" | 114 gdb_test_no_output "tstart" |
| 125 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end" | 115 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end" |
| 126 | 116 |
| 127 gdb_test_no_output "tstop" | 117 gdb_test_no_output "tstop" |
| 128 | 118 |
| 129 gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0" | 119 gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0" |
| 130 gdb_test "tfind" "Found trace frame 1, tracepoint .*" "tfind frame 1" | 120 gdb_test "tfind" "Found trace frame 1, tracepoint .*" "tfind frame 1" |
| 131 gdb_test "tfind" "Target failed to find requested trace frame\\..*" | 121 gdb_test "tfind" "Target failed to find requested trace frame\\..*" |
| 132 | 122 }} |
| 133 set pf_prefix $old_pf_prefix | |
| 134 } | |
| 135 | 123 |
| 136 # Set breakpoint and tracepoint at the same address. Delete breakpoint, and ver
ify | 124 # Set breakpoint and tracepoint at the same address. Delete breakpoint, and ver
ify |
| 137 # that tracepoint still works. | 125 # that tracepoint still works. |
| 138 | 126 |
| 139 proc break_trace_same_addr_3 { trace_type option } { | 127 proc break_trace_same_addr_3 { trace_type option } \ |
| 128 { with_test_prefix "3 $trace_type $option" \ |
| 129 { |
| 140 global executable | 130 global executable |
| 141 global pf_prefix | |
| 142 global hex | 131 global hex |
| 143 | 132 |
| 144 set old_pf_prefix $pf_prefix | |
| 145 set pf_prefix "$pf_prefix 3 $trace_type $option:" | |
| 146 | |
| 147 # Start with a fresh gdb. | 133 # Start with a fresh gdb. |
| 148 clean_restart ${executable} | 134 clean_restart ${executable} |
| 149 if ![runto_main] { | 135 if ![runto_main] { |
| 150 fail "Can't run to main" | 136 fail "Can't run to main" |
| 151 set pf_prefix $old_pf_prefix | |
| 152 return -1 | 137 return -1 |
| 153 } | 138 } |
| 154 | 139 |
| 155 gdb_test_no_output "set breakpoint always-inserted ${option}" | 140 gdb_test_no_output "set breakpoint always-inserted ${option}" |
| 156 gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*" | 141 gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*" |
| 157 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" | 142 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" |
| 158 | 143 |
| 159 gdb_test "break set_point" "Breakpoint \[0-9\] at $hex: file.*" | 144 gdb_test "break set_point" "Breakpoint \[0-9\] at $hex: file.*" |
| 160 gdb_test "${trace_type} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: f
ile.*" | 145 gdb_test "${trace_type} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: f
ile.*" |
| 161 | 146 |
| 162 gdb_test_no_output "tstart" | 147 gdb_test_no_output "tstart" |
| 163 | 148 |
| 164 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to marke
r" | 149 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to marke
r" |
| 165 gdb_test "delete break 4" | 150 gdb_test "delete break 4" |
| 166 | 151 |
| 167 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end" | 152 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end" |
| 168 gdb_test_no_output "tstop" | 153 gdb_test_no_output "tstop" |
| 169 | 154 |
| 170 gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0" | 155 gdb_test "tfind" "Found trace frame 0, tracepoint .*" "tfind frame 0" |
| 171 gdb_test "tfind" "Target failed to find requested trace frame\\..*" | 156 gdb_test "tfind" "Target failed to find requested trace frame\\..*" |
| 172 | 157 }} |
| 173 set pf_prefix $old_pf_prefix | |
| 174 } | |
| 175 | 158 |
| 176 # Set breakpoint and tracepoint at the same address. Delete tracepoint, and ver
ify | 159 # Set breakpoint and tracepoint at the same address. Delete tracepoint, and ver
ify |
| 177 # that breakpoint still works. | 160 # that breakpoint still works. |
| 178 | 161 |
| 179 proc break_trace_same_addr_4 { trace_type option } { | 162 proc break_trace_same_addr_4 { trace_type option } \ |
| 163 { with_test_prefix "4 $trace_type $option" \ |
| 164 { |
| 180 global executable | 165 global executable |
| 181 global pf_prefix | |
| 182 global hex | 166 global hex |
| 183 | 167 |
| 184 set old_pf_prefix $pf_prefix | |
| 185 set pf_prefix "$pf_prefix 4 $trace_type $option:" | |
| 186 | 168 |
| 187 # Start with a fresh gdb. | 169 # Start with a fresh gdb. |
| 188 clean_restart ${executable} | 170 clean_restart ${executable} |
| 189 if ![runto_main] { | 171 if ![runto_main] { |
| 190 fail "Can't run to main" | 172 fail "Can't run to main" |
| 191 set pf_prefix $old_pf_prefix | |
| 192 return -1 | 173 return -1 |
| 193 } | 174 } |
| 194 | 175 |
| 195 gdb_test_no_output "set breakpoint always-inserted ${option}" | 176 gdb_test_no_output "set breakpoint always-inserted ${option}" |
| 196 gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*" | 177 gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*" |
| 197 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" | 178 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" |
| 198 | 179 |
| 199 gdb_test "break set_point" "Breakpoint \[0-9\] at $hex: file.*" | 180 gdb_test "break set_point" "Breakpoint \[0-9\] at $hex: file.*" |
| 200 gdb_test "${trace_type} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: f
ile.*" | 181 gdb_test "${trace_type} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: f
ile.*" |
| 201 | 182 |
| 202 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to marke
r" | 183 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to marke
r" |
| 203 # Delete tracepoint set on set_point. | 184 # Delete tracepoint set on set_point. |
| 204 gdb_test "delete trace 5" | 185 gdb_test "delete trace 5" |
| 205 | 186 |
| 206 gdb_test "tstart" "No tracepoints defined, not starting trace.*" | 187 gdb_test "tstart" "No tracepoints defined, not starting trace.*" |
| 207 | 188 |
| 208 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to set_p
oint" | 189 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to set_p
oint" |
| 209 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end" | 190 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to end" |
| 210 gdb_test "tstop" "Trace is not running.*" | 191 gdb_test "tstop" "Trace is not running.*" |
| 211 | 192 |
| 212 gdb_test "tfind" "Target failed to find requested trace frame\\..*" | 193 gdb_test "tfind" "Target failed to find requested trace frame\\..*" |
| 213 | 194 }} |
| 214 set pf_prefix $old_pf_prefix | |
| 215 } | |
| 216 | 195 |
| 217 # Set two tracepoints TRACE1 and TRACE2 at two locations, and start tracing. | 196 # Set two tracepoints TRACE1 and TRACE2 at two locations, and start tracing. |
| 218 # Then, set tracepoint TRACE3 at either of these two locations. | 197 # Then, set tracepoint TRACE3 at either of these two locations. |
| 219 # TRACE3_AT_FIRST_LOC is a boolean variable to decide insert TRACE3 at which | 198 # TRACE3_AT_FIRST_LOC is a boolean variable to decide insert TRACE3 at which |
| 220 # of two locations. Verify these tracepoints work as expected. | 199 # of two locations. Verify these tracepoints work as expected. |
| 221 | 200 |
| 222 proc break_trace_same_addr_5 { trace1 trace2 trace3 trace3_at_first_loc } { | 201 proc break_trace_same_addr_5 { trace1 trace2 trace3 trace3_at_first_loc } \ |
| 202 { with_test_prefix "5 $trace1 $trace2 ${trace3}@${trace3_at_first_loc}" \ |
| 203 { |
| 223 global executable | 204 global executable |
| 224 global pf_prefix | |
| 225 global hex | 205 global hex |
| 226 global fpreg | 206 global fpreg |
| 227 global spreg | 207 global spreg |
| 228 global pcreg | 208 global pcreg |
| 229 | 209 |
| 230 set old_pf_prefix $pf_prefix | |
| 231 set pf_prefix "$pf_prefix 5 $trace1 $trace2 ${trace3}@${trace3_at_first_loc}
:" | |
| 232 | |
| 233 # Start with a fresh gdb. | 210 # Start with a fresh gdb. |
| 234 clean_restart ${executable} | 211 clean_restart ${executable} |
| 235 if ![runto_main] { | 212 if ![runto_main] { |
| 236 fail "Can't run to main" | 213 fail "Can't run to main" |
| 237 set pf_prefix $old_pf_prefix | |
| 238 return -1 | 214 return -1 |
| 239 } | 215 } |
| 240 | 216 |
| 241 gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*" | 217 gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*" |
| 242 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" | 218 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" |
| 243 | 219 |
| 244 gdb_test "${trace1} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.
*" \ | 220 gdb_test "${trace1} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.
*" \ |
| 245 "${trace1} set_point 1" | 221 "${trace1} set_point 1" |
| 246 gdb_trace_setactions "set action for tracepoint 1" "" \ | 222 gdb_trace_setactions "set action for tracepoint 1" "" \ |
| 247 "collect \$$pcreg" "^$" | 223 "collect \$$pcreg" "^$" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 gdb_test "tdump" \ | 258 gdb_test "tdump" \ |
| 283 "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${spreg} = .*
" \ | 259 "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${spreg} = .*
" \ |
| 284 "tdump 2" | 260 "tdump 2" |
| 285 gdb_test "tfind 0" "Found trace frame 0, tracepoint .*" \ | 261 gdb_test "tfind 0" "Found trace frame 0, tracepoint .*" \ |
| 286 "reset to frame 0 (2)" | 262 "reset to frame 0 (2)" |
| 287 gdb_test "tfind tracepoint 6" "Found trace frame \[0-9\], tracepoint .*" \ | 263 gdb_test "tfind tracepoint 6" "Found trace frame \[0-9\], tracepoint .*" \ |
| 288 "tfind test frame of tracepoint 6" | 264 "tfind test frame of tracepoint 6" |
| 289 gdb_test "tdump" \ | 265 gdb_test "tdump" \ |
| 290 "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${fpreg} = .*
" \ | 266 "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${fpreg} = .*
" \ |
| 291 "tdump 3" | 267 "tdump 3" |
| 292 | 268 }} |
| 293 set pf_prefix $old_pf_prefix | |
| 294 } | |
| 295 | 269 |
| 296 # Set two tracepoints at the same address, and enable/disable them. Verify | 270 # Set two tracepoints at the same address, and enable/disable them. Verify |
| 297 # tracepoints work as expect. | 271 # tracepoints work as expect. |
| 298 | 272 |
| 299 proc break_trace_same_addr_6 { trace1 enable1 trace2 enable2 } { | 273 proc break_trace_same_addr_6 { trace1 enable1 trace2 enable2 } \ |
| 274 { with_test_prefix "6 $trace1 $enable1 $trace2 $enable2" \ |
| 275 { |
| 300 global executable | 276 global executable |
| 301 global pf_prefix | |
| 302 global hex | 277 global hex |
| 303 global gdb_prompt | 278 global gdb_prompt |
| 304 global spreg | 279 global spreg |
| 305 global pcreg | 280 global pcreg |
| 306 | 281 |
| 307 set old_pf_prefix $pf_prefix | |
| 308 set pf_prefix "$pf_prefix 6 $trace1 $enable1 $trace2 $enable2:" | |
| 309 | |
| 310 # Start with a fresh gdb. | 282 # Start with a fresh gdb. |
| 311 clean_restart ${executable} | 283 clean_restart ${executable} |
| 312 if ![runto_main] { | 284 if ![runto_main] { |
| 313 fail "Can't run to main" | 285 fail "Can't run to main" |
| 314 set pf_prefix $old_pf_prefix | |
| 315 return -1 | 286 return -1 |
| 316 } | 287 } |
| 317 | 288 |
| 318 gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*" | 289 gdb_test "break marker" "Breakpoint \[0-9\] at $hex: file.*" |
| 319 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" | 290 gdb_test "break end" "Breakpoint \[0-9\] at $hex: file.*" |
| 320 | 291 |
| 321 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to marke
r" | 292 gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" "continue to marke
r" |
| 322 | 293 |
| 323 gdb_test "${trace1} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.
*" \ | 294 gdb_test "${trace1} set_point" "\(Fast t|T\)racepoint \[0-9\] at $hex: file.
*" \ |
| 324 "${trace1} set_point 1" | 295 "${trace1} set_point 1" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 355 "tfind test frame of tracepoint 5" | 326 "tfind test frame of tracepoint 5" |
| 356 gdb_test "tdump" \ | 327 gdb_test "tdump" \ |
| 357 "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${spreg}
= .*" \ | 328 "Data collected at tracepoint .*, trace frame \[0-9\]:.*\\$${spreg}
= .*" \ |
| 358 "tdump 2" | 329 "tdump 2" |
| 359 gdb_test "tfind 0" "Found trace frame 0, tracepoint .*" \ | 330 gdb_test "tfind 0" "Found trace frame 0, tracepoint .*" \ |
| 360 "reset to frame 0 (2)" | 331 "reset to frame 0 (2)" |
| 361 } else { | 332 } else { |
| 362 gdb_test "tfind tracepoint 5" "Target failed to find requested trace fra
me.*" \ | 333 gdb_test "tfind tracepoint 5" "Target failed to find requested trace fra
me.*" \ |
| 363 "tfind test frame of tracepoint 5" | 334 "tfind test frame of tracepoint 5" |
| 364 } | 335 } |
| 365 | 336 }} |
| 366 set pf_prefix $old_pf_prefix | |
| 367 } | |
| 368 | 337 |
| 369 | 338 |
| 370 foreach break_always_inserted { "on" "off" } { | 339 foreach break_always_inserted { "on" "off" } { |
| 371 break_trace_same_addr_1 "trace" ${break_always_inserted} | 340 break_trace_same_addr_1 "trace" ${break_always_inserted} |
| 372 break_trace_same_addr_2 "trace" "trace" ${break_always_inserted} | 341 break_trace_same_addr_2 "trace" "trace" ${break_always_inserted} |
| 373 break_trace_same_addr_3 "trace" ${break_always_inserted} | 342 break_trace_same_addr_3 "trace" ${break_always_inserted} |
| 374 break_trace_same_addr_4 "trace" ${break_always_inserted} | 343 break_trace_same_addr_4 "trace" ${break_always_inserted} |
| 375 } | 344 } |
| 376 | 345 |
| 377 foreach at_first_loc { "1" "0" } { | 346 foreach at_first_loc { "1" "0" } { |
| 378 break_trace_same_addr_5 "trace" "trace" "trace" ${at_first_loc} | 347 break_trace_same_addr_5 "trace" "trace" "trace" ${at_first_loc} |
| 379 } | 348 } |
| 380 | 349 |
| 381 break_trace_same_addr_6 "trace" "enable" "trace" "disable" | 350 break_trace_same_addr_6 "trace" "enable" "trace" "disable" |
| 382 break_trace_same_addr_6 "trace" "disable" "trace" "enable" | 351 break_trace_same_addr_6 "trace" "disable" "trace" "enable" |
| 383 | 352 |
| 384 set libipa $objdir/../gdbserver/libinproctrace.so | 353 set libipa [get_in_proc_agent] |
| 385 gdb_load_shlibs $libipa | 354 gdb_load_shlibs $libipa |
| 386 | 355 |
| 387 # Can't use prepare_for_testing, because that splits compiling into | 356 # Can't use prepare_for_testing, because that splits compiling into |
| 388 # building objects and then linking, and we'd fail with "linker input | 357 # building objects and then linking, and we'd fail with "linker input |
| 389 # file unused because linking not done" when building the object. | 358 # file unused because linking not done" when building the object. |
| 390 | 359 |
| 391 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ | 360 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ |
| 392 executable [list debug $additional_flags shlib=$libipa] ] != "" } { | 361 executable [list debug $additional_flags shlib=$libipa] ] != "" } { |
| 393 untested "failed to compile ftrace tests" | 362 untested "failed to compile ftrace tests" |
| 394 return -1 | 363 return -1 |
| 395 } | 364 } |
| 396 clean_restart ${executable} | 365 clean_restart ${executable} |
| 397 | 366 |
| 398 if ![runto_main] { | 367 if ![runto_main] { |
| 399 fail "Can't run to main for ftrace tests" | 368 fail "Can't run to main for ftrace tests" |
| 400 return 0 | 369 return 0 |
| 401 } | 370 } |
| 402 | 371 |
| 403 gdb_reinitialize_dir $srcdir/$subdir | 372 gdb_reinitialize_dir $srcdir/$subdir |
| 404 if { [gdb_test "info sharedlibrary" ".*libinproctrace\.so.*" "IPA loaded"] != 0
} { | 373 if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } { |
| 405 untested "Could not find IPA lib loaded" | 374 untested "Could not find IPA lib loaded" |
| 406 } else { | 375 } else { |
| 407 foreach break_always_inserted { "on" "off" } { | 376 foreach break_always_inserted { "on" "off" } { |
| 408 break_trace_same_addr_1 "ftrace" ${break_always_inserted} | 377 break_trace_same_addr_1 "ftrace" ${break_always_inserted} |
| 409 break_trace_same_addr_2 "trace" "ftrace" ${break_always_inserted} | 378 break_trace_same_addr_2 "trace" "ftrace" ${break_always_inserted} |
| 410 break_trace_same_addr_2 "ftrace" "trace" ${break_always_inserted} | 379 break_trace_same_addr_2 "ftrace" "trace" ${break_always_inserted} |
| 411 break_trace_same_addr_2 "ftrace" "ftrace" ${break_always_inserted} | 380 break_trace_same_addr_2 "ftrace" "ftrace" ${break_always_inserted} |
| 412 break_trace_same_addr_3 "ftrace" ${break_always_inserted} | 381 break_trace_same_addr_3 "ftrace" ${break_always_inserted} |
| 413 break_trace_same_addr_4 "ftrace" ${break_always_inserted} | 382 break_trace_same_addr_4 "ftrace" ${break_always_inserted} |
| 414 } | 383 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 434 foreach trace2 { "trace" "ftrace" } { | 403 foreach trace2 { "trace" "ftrace" } { |
| 435 if { [string equal $trace1 "trace"] | 404 if { [string equal $trace1 "trace"] |
| 436 && [string equal $trace2 "trace"] } { | 405 && [string equal $trace2 "trace"] } { |
| 437 continue | 406 continue |
| 438 } | 407 } |
| 439 break_trace_same_addr_6 $trace1 "enable" $trace2 "disable" | 408 break_trace_same_addr_6 $trace1 "enable" $trace2 "disable" |
| 440 break_trace_same_addr_6 $trace1 "disable" $trace2 "enable" | 409 break_trace_same_addr_6 $trace1 "disable" $trace2 "enable" |
| 441 } | 410 } |
| 442 } | 411 } |
| 443 } | 412 } |
| OLD | NEW |