]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.arch/thumb-prologue.exp
run copyright.sh for 2011.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / thumb-prologue.exp
CommitLineData
7b6bb8da 1# Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
29d73ae4
DJ
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
29d73ae4
DJ
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
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
29d73ae4
DJ
15
16# Test ARM/Thumb prologue analyzer.
17
18if {![istarget arm*-*]} then {
19 verbose "Skipping ARM prologue tests."
20 return
21}
22
23set testfile "thumb-prologue"
24set srcfile ${testfile}.c
25set binfile ${objdir}/${subdir}/${testfile}
26
27# Don't use "debug", so that we don't have line information for the assembly
28# fragments.
29if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {"additional_flags=-mthumb"}] != "" } {
30 untested "ARM prologue tests"
31 return -1
32}
33
34
35gdb_exit
36gdb_start
37gdb_reinitialize_dir $srcdir/$subdir
38gdb_load ${binfile}
39
40#
41# Run to `main' where we begin our tests.
42#
43
44if ![runto_main] then {
45 untested "ARM prologue tests"
46 return -1
47}
48
49# Testcase for TPCS prologue.
50
fd20f75b
DJ
51gdb_breakpoint "* *(int *)tpcs_offset + (int) &tpcs_frame_1"
52gdb_test "continue" "Breakpoint .*, $hex in tpcs_frame_1 \\(\\)" \
53 "continue to TPCS"
29d73ae4
DJ
54
55gdb_test "backtrace 10" \
56 "#0\[ \t\]*$hex in tpcs_frame_1 .*\r\n#1\[ \t\]*$hex in tpcs_frame .*\r\n#2\[ \t\]*$hex in main.*" \
57 "backtrace in TPCS"
58
59gdb_test "info frame" \
b39cc962 60 ".*Saved registers:.*r7 at.*r10 at.*r11 at.*lr at.*" \
29d73ae4 61 "saved registers in TPCS"