1 # This testcase is part of GDB, the GNU debugger.
3 # Copyright 2015-2024 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 require allow_btrace_pt_tests allow_tsx_tests
20 standard_testfile .c x86-tsx.S
21 if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
30 gdb_test_no_output "record btrace pt"
33 # look at the instruction trace
34 set begin_to_end [multi_line \
36 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
37 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
38 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txend\[^\\\r\\\n\]*" \
40 set abort_1 [multi_line \
42 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
43 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
44 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tret\[^\\\r\\\n\]*" \
46 set abort_2 [multi_line \
48 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\txbegin\[^\\\r\\\n\]*" \
49 "\[0-9\]*\t\\? 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
50 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tmov\[^\\\r\\\n\]*" \
51 "\[0-9\]*\t 0x\[0-9a-f\]+ <test\\+\[0-9\]+>:\tret\[^\\\r\\\n\]*" \
55 "$decimal\t $hex <main\\+$decimal>:\t\[^\\\r\\\n\]*" \
56 "$decimal\t $hex <test\\+$decimal>:\tmov\[^\\\r\\\n\]*" \
57 "$decimal\t $hex <test\\+$decimal>:\tret\[^\\\r\\\n\]*"]
59 set test "speculation indication"
60 gdb_test_multiple "record instruction-history" $test {
61 -re "$abort_1.*$gdb_prompt $" {
64 -re "$abort_2.*$gdb_prompt $" {
67 -re -wrap "$abort_3.*" {
70 -re "$begin_to_end.*$gdb_prompt $" {