Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gdb6 / gdb / testsuite / gdb.arch / powerpc-aix-prologue.exp
blob76e3c27cf2ed50cf4dfe790ec877fe1672c7d0a6
1 # Copyright 2004 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 2 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, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # This file is part of the gdb testsuite.
19 if $tracelevel {
20 strace $tracelevel
23 # Test rs6000 prologue analyzer.
25 set prms_id 0
26 set bug_id 0
28 if ![istarget "powerpc-*-aix*"] then {
29 verbose "Skipping powerpc-aix prologue tests."
30 return
33 set testfile "powerpc-aix-prologue"
34 set srcfile ${testfile}.c
35 set binfile ${objdir}/${subdir}/${testfile}
36 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
37 unsupported "Testcase compile failed."
38 return -1
41 gdb_exit
42 gdb_start
43 gdb_reinitialize_dir $srcdir/$subdir
44 gdb_load ${binfile}
46 # Insert a breakpoint in FUNCTION and verifies that the breakpoint was
47 # inserted at the expected location. EXPECTED_LOCATION should be an
48 # offset relative to the function start address.
49 proc insert_breakpoint {function expected_location} {
50 global gdb_prompt
51 global expect_out
52 global hex
54 set address ""
56 # Insert a breakpoint using the given function name, and extract
57 # the breakpoint address for the output.
58 gdb_test_multiple "break $function" "set breakpoint in $function" {
59 -re "Breakpoint 1 at ($hex).*$gdb_prompt $" {
60 set address $expect_out(1,string)
62 default {
63 fail "set breakpoint in $function"
67 # If we managed to get the breakpoing address, then check that
68 # we inserted it at the expected location by examining the
69 # instruction at that address (we're not interested in the insn
70 # itself, but rather at the address printed at the begining of
71 # the instruction).
72 if { $address != "" } then {
73 gdb_test "x /i $address" \
74 ".*<$function\\+$expected_location>.*" \
75 "check $function breakpoint address"
76 } else {
77 fail "unable to compute breakpoint address"
82 insert_breakpoint "li_stw" 12