Update years in copyright notice for the GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / step-line.exp
CommitLineData
28e7fd62 1# Copyright 2001-2013 Free Software Foundation, Inc.
3207ec21
KB
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
4fcb9948 5# the Free Software Foundation; either version 3 of the License, or
3207ec21 6# (at your option) any later version.
4fcb9948 7#
3207ec21
KB
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.
4fcb9948 12#
3207ec21 13# You should have received a copy of the GNU General Public License
c7b778ff 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
3207ec21 15
3207ec21
KB
16# use this to debug:
17#
18#log_user 1
19
20# step-line.exp -- Expect script to test stepping in files with
21# #line directives.
22
3207ec21 23set testfile step-line
f2dd3617 24set srcfile ${testfile}.c
f24fce77 25set linefile ${testfile}.inp
3207ec21
KB
26set binfile ${objdir}/${subdir}/${testfile}
27
28remote_exec build "rm -f ${binfile}"
f2dd3617 29if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
b60f0898
JB
30 untested step-line.exp
31 return -1
3207ec21
KB
32}
33
34gdb_exit
35gdb_start
36gdb_reinitialize_dir $srcdir/$subdir
37gdb_load ${binfile}
38
39if ![runto_main] then {
40 fail "Can't run to main"
41 return 0
42}
43
f24fce77
NF
44set remote_linefile [remote_download host ${srcdir}/${subdir}/${linefile}]
45
293e2f9e 46gdb_test "break f1" ".*Breakpoint 2 at .* file .*step-line.c.*" "break f1"
3207ec21
KB
47gdb_test "continue" \
48 "Continuing.*Breakpoint 2, f1 \\(i=4\\).*dummy \\(1, i\\);" \
49 "continue to f1"
50gdb_test "next" \
51 ".*i = f2 \\(i\\);.*" \
52 "next over dummy 1"
53gdb_test "next" \
54 ".*dummy \\(2, i\\);.*" \
55 "next to dummy 2"
56gdb_test "next" \
57 ".*i = f2 \\(i\\);.*" \
58 "next over dummy 2"
59gdb_test "step" \
60 ".*f2 \\(i=4\\).*dummy \\(4, i\\);.*" \
61 "step into f2"
62gdb_test "next" \
63 ".*j = i;.*" \
64 "next over dummy 4"
65gdb_test "next" \
66 ".*dummy \\(5, i\\);.*" \
67 "next to dummy 5"
68gdb_test "next" \
69 ".*dummy \\(6, j\\);.*" \
70 "next to dummy 6"
71gdb_test "next" \
72 ".*j = SUCC \\(j\\);.*" \
73 "next over dummy 6"
74gdb_test "next" \
75 ".*dummy \\(7, i\\);.*" \
76 "next to dummy 7"
77gdb_test "next" \
78 ".*dummy \\(8, j\\);.*" \
79 "next to dummy 8"
80gdb_test "next" \
81 ".*j = j - i;.*" \
82 "next over dummy 8"
83gdb_test "next" \
84 ".*dummy \\(9, i\\);.*" \
85 "next to dummy 9"
86gdb_test "next" \
87 ".*dummy \\(10, j\\);.*" \
88 "next to dummy 10"
89gdb_test "next" \
90 ".*RETURN \\(j\\);.*" \
91 "next over dummy 10"
f24fce77
NF
92
93remote_file host delete ${remote_linefile}
94
3207ec21 95return 0
This page took 1.207001 seconds and 4 git commands to generate.