Add translations for various sub-directories
[binutils-gdb.git] / gdb / testsuite / gdb.arch / e500-prologue.exp
blob773239382cd7f6f73db3a5881db2d9e6bf38d8bf
1 # Copyright 2004-2024 Free Software Foundation, Inc.
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.
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.
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/>.
16 # This file is part of the gdb testsuite.
18 # Test PowerPC E500 prologue analyzer.
20 require {istarget "powerpc-*"}
22 set testfile "e500-prologue"
23 set srcfile ${testfile}.c
24 set binfile ${objdir}/${subdir}/${testfile}
25 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
26     unsupported "failed to compile"
27     return -1
30 clean_restart $binfile
32 # Insert a breakpoint in FUNCTION and verifies that the breakpoint was
33 # inserted at the expected location.  EXPECTED_LOCATION should be an
34 # offset relative to the function start address.
35 proc insert_breakpoint {function expected_location} {
36     global gdb_prompt
37     global expect_out
38     global hex
39     
40     set address ""
42     # Insert a breakpoint using the given function name, and extract
43     # the breakpoint address for the output.
44     gdb_test_multiple "break $function" "set breakpoint in $function" {
45         -re "Breakpoint 1 at ($hex).*$gdb_prompt $" {
46             set address $expect_out(1,string)
47         }
48         default {
49             fail "set breakpoint in $function"
50         }
51     }
53     # If we managed to get the breakpoing address, then check that
54     # we inserted it at the expected location by examining the
55     # instruction at that address (we're not interested in the insn
56     # itself, but rather at the address printed at the beginning of
57     # the instruction).
58     if {$address != ""} {
59        gdb_test "x /i $address" \
60                 ".*<$function\\+$expected_location>.*" \
61                 "check $function breakpoint address"
62     } else {
63        fail "unable to compute breakpoint address"
64     }
68 insert_breakpoint "arg_passing_test2" 40