GDB copyright headers update after running GDB's copyright.py script.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cell / data.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 tries to read variables of each kind both on PPU and SPU.
20
21load_lib cell.exp
22
23set testfile "data"
24set ppu_file "data"
25set ppu_src ${srcdir}/${subdir}/${ppu_file}.c
26set ppu_bin ${objdir}/${subdir}/${ppu_file}
27set spu_file "data-spu"
28set spu_src ${srcdir}/${subdir}/${spu_file}.c
29set spu_bin ${objdir}/${subdir}/${spu_file}
30
31if {[skip_cell_tests]} {
32 return 0
33}
34
35# Compile SPU binary.
36if { [gdb_compile_cell_spu $spu_src $spu_bin executable {debug}] != "" } {
37 unsupported "Compiling spu binary failed."
38 return -1
39}
40# Compile PPU binary.
41if { [gdb_cell_embedspu $spu_bin $spu_bin-embed.o {debug}] != "" } {
42 unsupported "Embedding spu binary failed."
43 return -1
44}
45if { [gdb_compile_cell_ppu [list $ppu_src $spu_bin-embed.o] $ppu_bin executable {debug}] != "" } {
46 unsupported "Compiling ppu binary failed."
47 return -1
48}
49
4c93b1db 50if [get_compiler_info] {
1ea34204
UW
51 return -1
52}
53
54proc check_var { name value } {
55 gdb_test "print $name" \
56 ".*=.*$value" \
57 "check_var $name = $value"
58}
59
60proc set_var { name value } {
61 gdb_test "set var $name = $value" \
62 "" \
63 "set var $name = $value"
64}
65
66proc dotest { name value } {
67 set_var $name $value
68 check_var $name $value
69}
70
71gdb_exit
72gdb_start
73gdb_reinitialize_dir $srcdir/$subdir
74gdb_load ${ppu_bin}
75
76if ![runto_main] then {
77 fail "Can't run to main"
78 return 0
79}
80
81# Set values.
82dotest var_char 'z'
83dotest var_short 8
84dotest var_int 321
85dotest var_long 523442
86dotest var_longlong 235354533
87xfail "dotest var_float 33.2113"
88xfail "dotest var_double 2.3456"
89xfail "dotest var_longdouble 3.456789"
90
91gdb_test "break 55" \
92 "Breakpoint.*at.*file.*$testfile.c, line 55.*" \
93 "set breakpoint"
94gdb_test "continue" \
95 "Breakpoint.*at.*$testfile.c.*55.*" \
96 "continue to bp at line 55"
97
98# Lookup variables.
99check_var var_char 'c'
100check_var var_short 7
101check_var var_int 1337
102check_var var_long 123456
103check_var var_longlong 123456789
104xfail "check_var var_float 1.23"
105xfail "check_var var_double 2.3456"
106xfail "check_var var_longdouble 3.456789"
107
108cont_spu_main
109c_to "Marker SPU End" $spu_file.c
110
111# In SPU Thread, arch should now be spu:256K.
112check_spu_arch ""
113
114# Lookup variables.
115check_var var_char 'c'
116check_var var_short 7
117check_var var_int 1337
118check_var var_long 123456
119check_var var_longlong 123456789
120xfail "check_var var_float 1.23"
121xfail "check_var var_double 2.3456"
122xfail "check_var var_longdouble 3.456789"
123
124gdb_exit
125return 0
This page took 0.736798 seconds and 4 git commands to generate.