Fix test names starting with uppercase output by basic functions
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / advance.exp
CommitLineData
618f726f 1# Copyright 2003-2016 Free Software Foundation, Inc.
82025e13
EZ
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
82025e13 6# (at your option) any later version.
e22f8b7c 7#
82025e13
EZ
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.
e22f8b7c 12#
82025e13 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>. */
82025e13 15
82025e13
EZ
16# advance.exp -- Expect script to test 'advance' in gdb
17
08b3fe69 18standard_testfile
82025e13 19
08b3fe69
TT
20if {[prepare_for_testing $testfile.exp $testfile $srcfile debug]} {
21 untested $testfile.exp
b60f0898 22 return -1
82025e13
EZ
23}
24
82025e13 25if ![runto_main] then {
bc6c7af4 26 fail "can't run to main"
82025e13
EZ
27 return 0
28}
29
30# Verify that "advance <location>" works. (This is really just syntactic
31# sugar for "tbreak <location>; continue".)
32#
33gdb_test "advance [gdb_get_line_number "advance this location"]" \
34 "main .* at .*:.*b = 3.*advance this location.*" \
35 "advance line number"
36
37# Verify that a malformed "advance" is gracefully caught.
38#
39gdb_test "advance [gdb_get_line_number "advance malformed"] then stop" \
40e084e1
KS
40 "malformed linespec error: unexpected string, \"then stop\"" \
41 "malformed advance"
82025e13
EZ
42
43# Verify that "advance <funcname>" works.
44#
45gdb_test "advance func" \
46 "func.*at.*x = x \\+ 5." \
47 "advance func"
48
49# Verify that "advance <funcname>" when funcname is NOT called by the current
50# frame, stops at the end of the current frame.
51#
9ba61c5d
MC
52# gdb can legitimately stop on either the current line or the next line,
53# depending on whether the machine instruction for 'call' on the current
54# line has more instructions after it or not.
55#
82025e13 56gdb_test "advance func3" \
9ba61c5d 57 "(in main|).*(func \\(c\\)|marker1 \\(\\)).*stop here after leaving current frame..."\
82025e13
EZ
58 "advance function not called by current frame"
59
60# break at main again
61#
62gdb_test "break [gdb_get_line_number "break here"]" \
63 ".*Breakpoint.* at .*" \
64 "set breakpoint at call to func3"
65gdb_test "continue" \
66 ".*Breakpoint ${decimal}, main.*func3.*break here.*" \
67 "continue to call to func3 in main"
68
69# Verify that "advance <funcname>" when funcname is called as parameter to
70# another function works.
71#
72gdb_test "advance foo" \
73 "foo \\(a=5\\).*int b = a \\+ 10;"\
74 "advance function called as param"
75
76# Verify that we get an error if we use 'advance' w/o argument
77#
78gdb_test "advance" \
79 "Argument required \\(a location\\)."\
80 "advance with no argument"
81
This page took 1.432 seconds and 4 git commands to generate.