| 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 "ftrace" | 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 } |
| 31 | 29 |
| 32 if ![runto_main] { | 30 if ![runto_main] { |
| 33 fail "Can't run to main to check for trace support" | 31 fail "Can't run to main to check for trace support" |
| 34 return -1 | 32 return -1 |
| 35 } | 33 } |
| 36 | 34 |
| 37 if ![gdb_target_supports_trace] { | 35 if ![gdb_target_supports_trace] { |
| 38 unsupported "target does not support trace" | 36 unsupported "target does not support trace" |
| 39 return -1 | 37 return -1 |
| 40 } | 38 } |
| 41 | 39 |
| 42 set libipa $objdir/../gdbserver/libinproctrace.so | 40 set libipa [get_in_proc_agent] |
| 43 gdb_load_shlibs $libipa | 41 gdb_load_shlibs $libipa |
| 44 | 42 |
| 45 # Can't use prepare_for_testing, because that splits compiling into | 43 # Can't use prepare_for_testing, because that splits compiling into |
| 46 # building objects and then linking, and we'd fail with "linker input | 44 # building objects and then linking, and we'd fail with "linker input |
| 47 # file unused because linking not done" when building the object. | 45 # file unused because linking not done" when building the object. |
| 48 | 46 |
| 49 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ | 47 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ |
| 50 executable [list debug $additional_flags shlib=$libipa] ] != "" } { | 48 executable [list debug $additional_flags shlib=$libipa] ] != "" } { |
| 51 untested "failed to compile ftrace tests" | 49 untested "failed to compile ftrace tests" |
| 52 return -1 | 50 return -1 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 79 global gdb_prompt | 77 global gdb_prompt |
| 80 | 78 |
| 81 set fourgood 0 | 79 set fourgood 0 |
| 82 | 80 |
| 83 gdb_test "break begin" ".*" "" | 81 gdb_test "break begin" ".*" "" |
| 84 | 82 |
| 85 gdb_test "break end" ".*" "" | 83 gdb_test "break end" ".*" "" |
| 86 | 84 |
| 87 gdb_test "print gdb_agent_gdb_trampoline_buffer_error" ".*" "" | 85 gdb_test "print gdb_agent_gdb_trampoline_buffer_error" ".*" "" |
| 88 | 86 |
| 89 if { [is_x86_like_target] } { | 87 if { [istarget "x86_64-*-*"] || [istarget "i\[34567\]86-*-*"] } { |
| 90 | 88 |
| 91 gdb_test "ftrace set_point" "Fast tracepoint .*" \ | 89 gdb_test "ftrace set_point" "Fast tracepoint .*" \ |
| 92 "fast tracepoint at a long insn" | 90 "fast tracepoint at a long insn" |
| 93 | 91 |
| 94 gdb_trace_setactions "collect at set_point: define actions" \ | 92 gdb_trace_setactions "collect at set_point: define actions" \ |
| 95 "" \ | 93 "" \ |
| 96 "collect globvar, anarg" "^$" | 94 "collect globvar, anarg" "^$" |
| 97 | 95 |
| 98 # Make a test of shorter fast tracepoints, 32-bit x86 only | 96 # Make a test of shorter fast tracepoints, 32-bit x86 only |
| 99 | 97 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 127 "" \ | 125 "" \ |
| 128 "collect globvar, anarg" "^$" | 126 "collect globvar, anarg" "^$" |
| 129 } | 127 } |
| 130 } | 128 } |
| 131 | 129 |
| 132 run_trace_experiment | 130 run_trace_experiment |
| 133 | 131 |
| 134 gdb_test "tfind pc *set_point" "Found trace frame .*" \ | 132 gdb_test "tfind pc *set_point" "Found trace frame .*" \ |
| 135 "tfind set_point frame, first time" | 133 "tfind set_point frame, first time" |
| 136 | 134 |
| 135 setup_kfail_for_target "gdb/13808" "x86_64-*-linux*" |
| 137 gdb_test "print globvar" " = 1" | 136 gdb_test "print globvar" " = 1" |
| 138 | 137 |
| 139 gdb_test "tfind pc *set_point" "Found trace frame .*" \ | 138 gdb_test "tfind pc *set_point" "Found trace frame .*" \ |
| 140 "tfind set_point frame, second time" | 139 "tfind set_point frame, second time" |
| 141 | 140 |
| 141 setup_kfail_for_target "gdb/13808" "x86_64-*-linux*" |
| 142 gdb_test "print anarg" " = 200" | 142 gdb_test "print anarg" " = 200" |
| 143 | 143 |
| 144 gdb_test "tfind start" "Found trace frame .*" \ | 144 gdb_test "tfind start" "Found trace frame .*" \ |
| 145 "reset tfinding" | 145 "reset tfinding" |
| 146 | 146 |
| 147 if { $fourgood } { | 147 if { $fourgood } { |
| 148 | 148 |
| 149 gdb_test "tfind pc *four_byter" "Found trace frame .*" \ | 149 gdb_test "tfind pc *four_byter" "Found trace frame .*" \ |
| 150 "tfind four_byter frame, first time" | 150 "tfind four_byter frame, first time" |
| 151 | 151 |
| 152 gdb_test "print anarg" " = 101" \ | 152 gdb_test "print anarg" " = 101" \ |
| 153 "look at collected local, first time" | 153 "look at collected local, first time" |
| 154 | 154 |
| 155 gdb_test "tfind pc *four_byter" "Found trace frame .*" \ | 155 gdb_test "tfind pc *four_byter" "Found trace frame .*" \ |
| 156 "tfind four_byter frame, second time" | 156 "tfind four_byter frame, second time" |
| 157 | 157 |
| 158 gdb_test "print anarg" " = 201" \ | 158 gdb_test "print anarg" " = 201" \ |
| 159 "look at collected local, second time" | 159 "look at collected local, second time" |
| 160 | 160 |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 gdb_reinitialize_dir $srcdir/$subdir | 165 gdb_reinitialize_dir $srcdir/$subdir |
| 166 | 166 |
| 167 if { [gdb_test "info sharedlibrary" ".*libinproctrace\.so.*" "IPA loaded"] != 0
} { | 167 if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } { |
| 168 untested "Could not find IPA lib loaded" | 168 untested "Could not find IPA lib loaded" |
| 169 return 1 | 169 return 1 |
| 170 } | 170 } |
| 171 | 171 |
| 172 test_fast_tracepoints | 172 test_fast_tracepoints |
| OLD | NEW |