Update copyright year range in all GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cell / break.exp
CommitLineData
42a4f53d 1# Copyright 2009-2019 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 setting and deleting breakpoints on PPU and SPU.
20
21load_lib cell.exp
22
23set testfile "break"
24set ppu_file "break"
25set ppu_src ${srcdir}/${subdir}/${ppu_file}.c
617cd4bc 26set ppu_bin [standard_output_file ${ppu_file}]
1ea34204
UW
27set spu_file "break-spu"
28set spu_src ${srcdir}/${subdir}/${spu_file}.c
617cd4bc 29set spu_bin [standard_output_file ${spu_file}]
1ea34204
UW
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}] != "" } {
bc6c7af4 37 unsupported "compiling spu binary failed."
1ea34204
UW
38 return -1
39}
40# Compile PPU binary.
41if { [gdb_cell_embedspu $spu_bin $spu_bin-embed.o {debug}] != "" } {
bc6c7af4 42 unsupported "embedding spu binary failed."
1ea34204
UW
43 return -1
44}
45if { [gdb_compile_cell_ppu [list $ppu_src $spu_bin-embed.o] $ppu_bin executable {debug}] != "" } {
bc6c7af4 46 unsupported "compiling ppu binary failed."
1ea34204
UW
47 return -1
48}
49
4c93b1db 50if [get_compiler_info] {
1ea34204
UW
51 return -1
52}
53
54gdb_exit
55gdb_start
56gdb_reinitialize_dir $srcdir/$subdir
57gdb_load ${ppu_bin}
58
59# Delete breakpoints before starting the application. The debugger
60# shouldn't prompt for anything.
61gdb_test "delete breakpoints" \
62 "" \
bb95117e 63 "no prompt when deleting non-existing breakpoints"
1ea34204
UW
64
65gdb_test "break main" \
66 "Breakpoint.*at.* file .*$testfile.c, line.*" \
67 "breakpoint main in ppu"
68
69if ![runto_main] then {
bc6c7af4 70 fail "can't run to main"
1ea34204
UW
71 return 0
72}
73
74delete_breakpoints
75
76# Re-set breakpoint at main in PPU binary.
77gdb_test "break main" \
78 "Breakpoint.*at.* file .*$testfile.c, line.*" \
79 "breakpoint function"
80
81# Set breakpoint in SPU binary.
82send_gdb "break $spu_file.c:10\n"
83gdb_expect {
84 -re ".*$spu_file.c.*Make breakpoint pending.*y or \\\[n\\\]. $" {
85 gdb_test "y" "Breakpoint.*$spu_file.*pending." "set pending breakpoint"
86 }
bc6c7af4 87 timeout { fail "timeout while setting breakpoint in spu binary" }
1ea34204
UW
88}
89
90# Check breakpoints.
91gdb_test "info break" \
92 "Num\[ \]+Type\[ \]+Disp\[ \]+Enb\[ \]+Address\[ \]+What.*
93\[0-9\]+\[\t \]+breakpoint keep y.*in main at.*$testfile.c.*
94\[0-9\]+\[\t \]+breakpoint keep y.*PENDING.*$spu_file.c:10.*" \
95 "breakpoint info"
96
97gdb_test "continue" \
98 "Continuing.*Switching to Thread.*Breakpoint.*main.*at.*$spu_file.c.*" \
99 "continuing to spu thread"
100
101gdb_exit
102
103return 0
This page took 2.012513 seconds and 4 git commands to generate.