]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.arch/thumb-prologue.exp
* gdb.arch/thumb-prologue.c: Record the breakpoint address in
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / thumb-prologue.exp
1 # Copyright 2006, 2007 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 2 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, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17 # Test ARM/Thumb prologue analyzer.
18
19 if {![istarget arm*-*]} then {
20 verbose "Skipping ARM prologue tests."
21 return
22 }
23
24 set testfile "thumb-prologue"
25 set srcfile ${testfile}.c
26 set binfile ${objdir}/${subdir}/${testfile}
27
28 # Don't use "debug", so that we don't have line information for the assembly
29 # fragments.
30 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {"additional_flags=-mthumb"}] != "" } {
31 untested "ARM prologue tests"
32 return -1
33 }
34
35
36 gdb_exit
37 gdb_start
38 gdb_reinitialize_dir $srcdir/$subdir
39 gdb_load ${binfile}
40
41 #
42 # Run to `main' where we begin our tests.
43 #
44
45 if ![runto_main] then {
46 untested "ARM prologue tests"
47 return -1
48 }
49
50 # Testcase for TPCS prologue.
51
52 gdb_breakpoint "* *(int *)tpcs_offset + (int) &tpcs_frame_1"
53 gdb_test "continue" "Breakpoint .*, $hex in tpcs_frame_1 \\(\\)" \
54 "continue to TPCS"
55
56 gdb_test "backtrace 10" \
57 "#0\[ \t\]*$hex in tpcs_frame_1 .*\r\n#1\[ \t\]*$hex in tpcs_frame .*\r\n#2\[ \t\]*$hex in main.*" \
58 "backtrace in TPCS"
59
60 gdb_test "info frame" \
61 ".*Saved registers:.*r7 at.*r10 at.*r11 at.*lr at.*pc at .*" \
62 "saved registers in TPCS"