]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp
aarch64: Fix the hyphenated disassembly comment.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / powerpc-aix-prologue.exp
1 # Copyright 2004-2024 Free Software Foundation, Inc.
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 #
16 # This file is part of the gdb testsuite.
17
18 # Test rs6000 prologue analyzer.
19
20
21 require {istarget "powerpc-*-aix*"}
22
23 set testfile "powerpc-aix-prologue"
24 set srcfile ${testfile}.c
25 set binfile ${objdir}/${subdir}/${testfile}
26 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
27 unsupported "failed to compile"
28 return -1
29 }
30
31 clean_restart $binfile
32
33 # Insert a breakpoint in FUNCTION and verifies that the breakpoint was
34 # inserted at the expected location. EXPECTED_LOCATION should be an
35 # offset relative to the function start address.
36 proc insert_breakpoint {function expected_location} {
37 global gdb_prompt
38 global expect_out
39 global hex
40
41 set address ""
42
43 # Insert a breakpoint using the given function name, and extract
44 # the breakpoint address for the output.
45 gdb_test_multiple "break $function" "set breakpoint in $function" {
46 -re "Breakpoint .* at ($hex).*$gdb_prompt $" {
47 set address $expect_out(1,string)
48 }
49 default {
50 fail "set breakpoint in $function"
51 }
52 }
53
54 # If we managed to get the breakpoing address, then check that
55 # we inserted it at the expected location by examining the
56 # instruction at that address (we're not interested in the insn
57 # itself, but rather at the address printed at the begining of
58 # the instruction).
59 if {$address != ""} {
60 gdb_test "x /i $address" \
61 ".*<$function\\+$expected_location>.*" \
62 "check $function breakpoint address"
63 } else {
64 fail "unable to compute breakpoint address"
65 }
66
67 }
68
69 insert_breakpoint "li_stw" 12
70 insert_breakpoint "stack_check_probe_1" 16
71 insert_breakpoint "stack_check_probe_2" 40
72 insert_breakpoint "stack_check_probe_loop_1" 68
73 insert_breakpoint "stack_check_probe_loop_2" 60
74