]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.arch/thumb-prologue.exp
Fix powerpc-power8.exp test with new mnemonics
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / thumb-prologue.exp
index 1353768b267546faadb810a9fddf2affc71ab643..5cd92839eb48adc0fd26909831828d8c7873036c 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006-2021 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test ARM/Thumb prologue analyzer.
 
-if {![istarget arm*-*]} then {
+if {![is_aarch32_target]} then {
     verbose "Skipping ARM prologue tests."
     return
 }
 
-set testfile "thumb-prologue"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 # Don't use "debug", so that we don't have line information for the assembly
 # fragments.
@@ -49,12 +46,41 @@ if ![runto_main] then {
 
 # Testcase for TPCS prologue.
 
-gdb_test "continue" "Program received signal SIG.*" "continue to TPCS"
+gdb_breakpoint "* *(int *)tpcs_offset + (int) &tpcs_frame_1"
+gdb_test "continue" "Breakpoint .*, $hex in tpcs_frame_1 \\(\\)" \
+    "continue to TPCS"
 
 gdb_test "backtrace 10" \
        "#0\[ \t\]*$hex in tpcs_frame_1 .*\r\n#1\[ \t\]*$hex in tpcs_frame .*\r\n#2\[ \t\]*$hex in main.*" \
        "backtrace in TPCS"
 
 gdb_test "info frame" \
-       ".*Saved registers:.*r7 at.*r10 at.*r11 at.*lr at.*pc at .*" \
+       ".*Saved registers:.*r7 at.*r10 at.*r11 at.*lr at.*" \
        "saved registers in TPCS"
+
+
+# Testcase for "switching" the stack to the same stack in the prologue.
+
+gdb_breakpoint "switch_stack_to_same"
+
+gdb_test "continue" "Breakpoint .*, $hex in switch_stack_to_same \\(\\)" \
+       "continue to switch_stack_to_same"
+
+gdb_test "stepi 2" "in write_sp \\(\\)" "stepi over mov sp, sp"
+
+gdb_test "backtrace 10" \
+       "#0\[ \t\]*$hex in write_sp .*\r\n#1\[ \t\]*$hex in switch_stack_to_same .*\r\n#2\[ \t\]*$hex in main.*" \
+       "backtrace in write_sp"
+
+# Testcase for switching to another stack in the prologue.
+
+gdb_breakpoint "switch_stack_to_other"
+
+gdb_test "continue" "Breakpoint .*, $hex in switch_stack_to_other \\(\\)" \
+       "continue to switch_stack_to_other"
+
+gdb_test "stepi 2" "in write_sp \\(\\)" "stepi over mov sp, 128"
+
+gdb_test "backtrace 10" \
+       "#0\[ \t\]*$hex in write_sp .*\r\n#1\[ \t\]*$hex in switch_stack_to_other .*\r\n#2\[ \t\]*$hex in main.*" \
+       "backtrace in write_sp, 2nd stop"