]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2009-2024 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 | ||
73c06197 | 16 | require {istarget "ia64-*-*"} |
8172766a JK |
17 | |
18 | set testfile ia64-breakpoint-shadow | |
19 | set srcfile ${testfile}.S | |
20 | set binfile ${objdir}/${subdir}/${testfile} | |
21 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { | |
84c93cd5 | 22 | untested "failed to compile" |
8172766a JK |
23 | return -1 |
24 | } | |
25 | ||
6dbbae3b | 26 | clean_restart $binfile |
8172766a JK |
27 | |
28 | # We need to start the inferior to place the breakpoints in the memory at all. | |
29 | if ![runto_main] { | |
8172766a JK |
30 | return -1 |
31 | } | |
32 | ||
33 | # The default "auto" mode removes all the breakpoints when we stop (and not | |
34 | # running the nonstop mode). We would not be able to test the shadow. | |
35 | gdb_test "set breakpoint always-inserted on" | |
36 | gdb_test "show breakpoint always-inserted" "Always inserted breakpoint mode is on." | |
37 | ||
38 | set match "\nDump of assembler code for function main:\r\n(.*)End of assembler dump.\r\n$gdb_prompt $" | |
39 | ||
40 | set test "disassembly without breakpoints" | |
41 | gdb_test_multiple "disass main" $test { | |
42 | -re $match { | |
43 | set orig $expect_out(1,string) | |
44 | pass $test | |
45 | } | |
46 | } | |
47 | ||
48 | set test "slot 0 breakpoint placed" | |
49 | gdb_test_multiple "b bundle" $test { | |
50 | -re "Breakpoint \[0-9\] at (0x\[0-9a-f\]*0):.*$gdb_prompt $" { | |
51 | pass $test | |
52 | set bpt2address $expect_out(1,string) | |
53 | } | |
54 | } | |
55 | ||
56 | if ![info exists bpt2address] { | |
57 | return -1 | |
58 | } | |
59 | ||
60 | gdb_test "b *($bpt2address + 1)" "Breakpoint \[0-9\] at .*" "slot 1 breakpoint placed" | |
61 | gdb_test "b *($bpt2address + 2)" "Can't insert breakpoint for non-existing slot X" "slot 2 (slot X) breakpoint refusal" | |
62 | ||
63 | set test "disassembly with breakpoints" | |
64 | gdb_test_multiple "disass main" $test { | |
65 | -re $match { | |
66 | set got $expect_out(1,string) | |
67 | if [string equal -nocase $orig $got] { | |
68 | pass $test | |
69 | } else { | |
70 | fail $test | |
71 | } | |
72 | } | |
73 | } |