]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.cell/bt.exp
GDB copyright headers update after running GDB's copyright.py script.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.cell / bt.exp
CommitLineData
618f726f 1# Copyright 2009-2016 Free Software Foundation, Inc.
1ea34204
UW
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 3 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, see <http://www.gnu.org/licenses/>.
15#
16# Contributed by Markus Deuling <deuling@de.ibm.com>.
17#
18# Testsuite for Cell Broadband Engine combined debugger
19# This testcases tests mixed-architecture backtrace support
20
21load_lib cell.exp
22
23set testfile "bt"
24set ppu_file "bt"
25set ppu_src ${srcdir}/${subdir}/${ppu_file}.c
26set ppu_bin ${objdir}/${subdir}/${ppu_file}
27set spu_file "bt-spu"
28set spu_src ${srcdir}/${subdir}/${spu_file}.c
29set spu_bin ${objdir}/${subdir}/${spu_file}
30set spu2_file "bt2-spu"
31set spu2_src ${srcdir}/${subdir}/${spu2_file}.c
32set spu2_bin ${objdir}/${subdir}/${spu2_file}
33
34if {[skip_cell_tests]} {
35 return 0
36}
37
38# Compile SPU binaries.
39if { [gdb_compile_cell_spu $spu_src $spu_bin executable {debug}] != "" } {
40 unsupported "Compiling spu binary failed."
41 return -1
42}
43if { [gdb_compile_cell_spu $spu2_src $spu2_bin executable {debug}] != "" } {
44 unsupported "Compiling spu binary failed."
45 return -1
46}
47# Compile PPU binary.
48if { [gdb_cell_embedspu $spu_bin $spu_bin-embed.o {debug}] != "" } {
49 unsupported "Embedding spu binary failed."
50 return -1
51}
52if { [gdb_cell_embedspu $spu2_bin $spu2_bin-embed.o {debug}] != "" } {
53 unsupported "Embedding spu binary failed."
54 return -1
55}
56if { [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."
58 return -1
59}
60
4c93b1db 61if [get_compiler_info] {
1ea34204
UW
62 return -1
63}
64
65gdb_exit
66gdb_start
67gdb_reinitialize_dir $srcdir/$subdir
68gdb_load ${ppu_bin}
69
70if ![runto_main] then {
71 fail "Can't run to main"
72 return 0
73}
74
a536c6d7 75delete_breakpoints
1ea34204
UW
76gdb_test "continue" ".*Program received signal SIGABRT, Aborted.*"
77
78gdb_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.*"
79
80for {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"
87}
88
89gdb_exit
90
91return 0