* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / step-test.exp
CommitLineData
bdb7b085
JM
1# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
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 2 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, write to the Free Software
15# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
16
17# Please email any bugs, comments, and/or additions to this file to:
18# bug-gdb@prep.ai.mit.edu
19
20# use this to debug:
21#
22#log_user 1
23
24# step-test.exp -- Expect script to test stepping in gdb
25
26if $tracelevel then {
27 strace $tracelevel
28}
29
30set testfile step-test
31set srcfile ${srcdir}/${subdir}/${testfile}.c
32set binfile ${objdir}/${subdir}/${testfile}
33
34remote_exec build "rm -f ${binfile}"
35if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
36 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
37}
38
39gdb_exit
40gdb_start
41gdb_reinitialize_dir $srcdir/$subdir
42gdb_load ${binfile}
43
44if ![runto_main] then {
45 fail "Can't run to main"
46 return 0
47}
48
49# Vanilla step/next
50#
51gdb_test "next" ".*15.*x = 1;.*" "next 1"
52gdb_test "step" ".*16.*y = 2;.*" "step 1"
53
54# With count
55#
56gdb_test "next 2" ".*18.*w = w.*2;.*" "next 2"
57gdb_test "step 3" ".*21.*z = z.*5;.*" "step 3"
58gdb_test "next" ".*24.*callee.*OVER.*" "next 3"
59
60# Step over call
61#
62gdb_test "next" ".*27.*callee.*INTO.*" "next over"
63
64# Step into call
65#
66gdb_test "step" ".*6.*glob.*" "step into"
67
68# Step out of call
69#
70gdb_test "finish" ".*30.*a.*5.*= a.*3.*" "step out"
71
72# Instruction stepping, into
73#
74gdb_test "stepi" ".*30.*a.*5.* = a.*3.*" "stepi 1"
75gdb_test "stepi" ".*30.*a\\\[5\\\] = a.*" "stepi 2"
76
77gdb_test "stepi 7" ".*6.*glob.*" "stepi into"
78gdb_test "finish" ".*34.*callee.*NEXTI.*" "stepi out"
79
80# Instruction stepping, over
81#
82gdb_test "nexti" ".*callee.*NEXTI.*" "nexti 1"
83
84gdb_test "c" ".*Program exited normally.*" "run to finish"
85
86return 0
This page took 0.026384 seconds and 4 git commands to generate.