* gdb.base/cursal.exp: Add "" to gdb_load call.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / cursal.exp
1 # Copyright 2004 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,
16 # Boston, MA 02111-1307, USA.
17
18 if $tracelevel {
19 strace $tracelevel
20 }
21
22 set prms_id 0
23 set bug_id 0
24
25 set testfile "cursal"
26 set srcfile ${testfile}.c
27 set binfile ${objdir}/${subdir}/${testfile}
28
29 if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != ""} {
30 untested "Couldn't compile $srcfile"
31 return -1
32 }
33
34 gdb_exit
35 gdb_start
36 gdb_reinitialize_dir $srcdir/$subdir
37 gdb_file_cmd ${binfile}
38 gdb_test "set listsize 1" \
39 ".*"
40
41 # initial sal should be first statement in main
42 gdb_test "list" \
43 "v0 = 0;" \
44 "list before run"
45 gdb_load ""
46 if {! [runto_main]} {
47 return -1
48 }
49
50 gdb_test "list" \
51 "v0 = 0;" \
52 "list in main"
53
54 if {! [runto "func2"]} {
55 return -1
56 }
57
58 gdb_test "list" \
59 "v2 = 2;" \
60 "list in func2"
61
62 # make sure backtrace doesn't change current source location.
63 gdb_test "backtrace" \
64 ".*"
65 gdb_test "list -1" \
66 "v2 = 2;" \
67 "list after backtrace"
68
69 # check the window
70 gdb_test "set listsize 3" \
71 ".*"
72 if {! [runto_main]} {
73 return -1
74 }
75 gdb_test "list" \
76 "func1 \\(\\);" \
77 "list size 3"
78
79 return 0
This page took 0.034762 seconds and 5 git commands to generate.