]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/cursal.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / cursal.exp
1 # Copyright 2004-2024 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 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
17 standard_testfile
18
19 if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != ""} {
20 untested "failed to compile"
21 return -1
22 }
23
24 clean_restart
25 gdb_file_cmd ${binfile}
26 gdb_test_no_output "set listsize 1"
27
28 # initial sal should be first statement in main
29 gdb_test "list" \
30 "v0 = 0;" \
31 "list before run"
32
33 gdb_load ${binfile}
34 if {! [runto_main]} {
35 return -1
36 }
37
38 gdb_test "list" \
39 "v0 = 0;" \
40 "list in main"
41
42 if {! [runto "func2"]} {
43 return -1
44 }
45
46 gdb_test "list" \
47 "v2 = 2;" \
48 "list in func2"
49
50 # make sure backtrace doesn't change current source location.
51 gdb_test "backtrace" \
52 ".*"
53 gdb_test "list -1" \
54 "v2 = 2;" \
55 "list after backtrace"
56
57 # check the window
58 gdb_test_no_output "set listsize 3"
59
60 if {! [runto_main]} {
61 return -1
62 }
63 gdb_test "list" \
64 "func1 \\(\\);" \
65 "list size 3"