]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp
Rename skip_vsx_tests to allow form
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / ia64-breakpoint-shadow.exp
CommitLineData
213516ef 1# Copyright 2009-2023 Free Software Foundation, Inc.
8172766a
JK
2
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
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
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/>.
15
16if ![istarget "ia64-*-*"] {
17 verbose "Skipping ia64-breakpoint-shadow test."
18 return
19}
20
21set testfile ia64-breakpoint-shadow
22set srcfile ${testfile}.S
23set binfile ${objdir}/${subdir}/${testfile}
24if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
84c93cd5 25 untested "failed to compile"
8172766a
JK
26 return -1
27}
28
29gdb_exit
30gdb_start
31gdb_reinitialize_dir $srcdir/$subdir
32gdb_load ${binfile}
33
34# We need to start the inferior to place the breakpoints in the memory at all.
35if ![runto_main] {
8172766a
JK
36 return -1
37}
38
39# The default "auto" mode removes all the breakpoints when we stop (and not
40# running the nonstop mode). We would not be able to test the shadow.
41gdb_test "set breakpoint always-inserted on"
42gdb_test "show breakpoint always-inserted" "Always inserted breakpoint mode is on."
43
44set match "\nDump of assembler code for function main:\r\n(.*)End of assembler dump.\r\n$gdb_prompt $"
45
46set test "disassembly without breakpoints"
47gdb_test_multiple "disass main" $test {
48 -re $match {
49 set orig $expect_out(1,string)
50 pass $test
51 }
52}
53
54set test "slot 0 breakpoint placed"
55gdb_test_multiple "b bundle" $test {
56 -re "Breakpoint \[0-9\] at (0x\[0-9a-f\]*0):.*$gdb_prompt $" {
57 pass $test
58 set bpt2address $expect_out(1,string)
59 }
60}
61
62if ![info exists bpt2address] {
63 return -1
64}
65
66gdb_test "b *($bpt2address + 1)" "Breakpoint \[0-9\] at .*" "slot 1 breakpoint placed"
67gdb_test "b *($bpt2address + 2)" "Can't insert breakpoint for non-existing slot X" "slot 2 (slot X) breakpoint refusal"
68
69set test "disassembly with breakpoints"
70gdb_test_multiple "disass main" $test {
71 -re $match {
72 set got $expect_out(1,string)
73 if [string equal -nocase $orig $got] {
74 pass $test
75 } else {
76 fail $test
77 }
78 }
79}