1 # Copyright 2009-2014 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 # Contributed by Markus Deuling <deuling@de.ibm.com>.
18 # Testsuite for Cell Broadband Engine combined debugger
19 # This testcases tests mixed-architecture backtrace support
25 set ppu_src ${srcdir}/${subdir}/${ppu_file}.c
26 set ppu_bin ${objdir}/${subdir}/${ppu_file}
28 set spu_src ${srcdir}/${subdir}/${spu_file}.c
29 set spu_bin ${objdir}/${subdir}/${spu_file}
30 set spu2_file "bt2-spu"
31 set spu2_src ${srcdir}/${subdir}/${spu2_file}.c
32 set spu2_bin ${objdir}/${subdir}/${spu2_file}
34 if {[skip_cell_tests]} {
38 # Compile SPU binaries.
39 if { [gdb_compile_cell_spu $spu_src $spu_bin executable {debug}] != "" } {
40 unsupported "Compiling spu binary failed."
43 if { [gdb_compile_cell_spu $spu2_src $spu2_bin executable {debug}] != "" } {
44 unsupported "Compiling spu binary failed."
48 if { [gdb_cell_embedspu $spu_bin $spu_bin-embed.o {debug}] != "" } {
49 unsupported "Embedding spu binary failed."
52 if { [gdb_cell_embedspu $spu2_bin $spu2_bin-embed.o {debug}] != "" } {
53 unsupported "Embedding spu binary failed."
56 if { [gdb_compile_cell_ppu [list $ppu_src $spu_bin-embed.o $spu2_bin-embed.o] $ppu_bin executable {debug}] != "" } {
57 unsupported "Compiling ppu binary failed."
61 if [get_compiler_info] {
67 gdb_reinitialize_dir $srcdir/$subdir
70 if ![runto_main] then {
71 fail "Can't run to main"
76 gdb_test "continue" ".*Program received signal SIGABRT, Aborted.*"
78 gdb_test "backtrace" ".*abort.*crash_handler.*base.*offset.*<cross-architecture call>.*main.*speid.*argp.*envp.*at.*$spu2_file.c.*<cross-architecture call>.*spe_context_run.*indirect_handler.*base.*offset.*<cross-architecture call>.*main.*speid.*argp.*envp.*at.*$spu_file.c.*<cross-architecture call>.*spe_context_run.*spe_thread.*at.*$ppu_file.c.*"
80 for {set thread_id 2} {$thread_id < 7} {incr thread_id} {
81 gdb_test "t $thread_id" \
82 "Switching to thread $thread_id.*" \
83 "switch to thread $thread_id"
84 gdb_test "backtrace" \
85 ".*crash_handler.*base.*offset.*<cross-architecture call>.*main.*speid.*argp.*envp.*at.*$spu2_file.c.*<cross-architecture call>.*spe_context_run.*indirect_handler.*base.*offset.*<cross-architecture call>.*main.*speid.*argp.*envp.*at.*$spu_file.c.*<cross-architecture call>.*spe_context_run.*spe_thread.*at.*$ppu_file.c.*" \
86 "backtrace in thread $thread_id"