]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp
Copyright year update in most files of the GDB Project.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.mi / dw2-ref-missing-frame.exp
CommitLineData
0b302171 1# Copyright 2008-2012 Free Software Foundation, Inc.
875b4ff5
PM
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
810cfdbb 16load_lib dwarf.exp
875b4ff5 17# This test can only be run on targets which support DWARF-2 and use gas.
875b4ff5
PM
18load_lib mi-support.exp
19set MIFLAGS "-i=mi"
20
810cfdbb 21if {![dwarf2_support]} {
875b4ff5
PM
22 return 0
23}
24
25set testfile "dw2-ref-missing-frame"
26set srcsfile ${testfile}.S
27set objsfile ${objdir}/${subdir}/${testfile}.o
28set srcfuncfile ${testfile}-func.c
29set objfuncfile ${objdir}/${subdir}/${testfile}-func.o
30set srcmainfile ${testfile}-main.c
31set objmainfile ${objdir}/${subdir}/${testfile}-main.o
32set executable ${testfile}
33set binfile ${objdir}/${subdir}/${executable}
34
35if { [gdb_compile "${srcdir}/${subdir}/${srcsfile}" $objsfile object {}] != ""
36 || [gdb_compile "${srcdir}/${subdir}/${srcfuncfile}" $objfuncfile object {}] != ""
37 || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" $objmainfile object {debug}] != ""
38 || [gdb_compile "$objsfile $objfuncfile $objmainfile" $binfile executable {}] != "" } {
39 return -1
40}
41
42if [mi_gdb_start] {
43 continue
44}
45
46mi_delete_breakpoints
47mi_gdb_reinitialize_dir $srcdir/$subdir
48mi_gdb_load ${binfile}
49
50if [mi_runto func_nofb_marker] {
51 # First try referencing DW_AT_frame_base which is not defined.
52 mi_gdb_test "300-stack-list-locals --thread 1 --frame 1 --all-values" \
53 "300\\^done,locals=\\\[\{name=\"func_nofb_var\",value=\"\\\<error reading variable: Could not find the frame base for \\\\\"func_nofb\\\\\"\\\.\\\>\"\},\{name=\"func_nofb_var2\",value=\"\\\<error reading variable: Could not find the frame base for \\\\\"func_nofb\\\\\"\\\.\\\>\"\}\\\].*" \
54 "test func_nofb_marker"
55}
56
57# GDB could have crashed.
58mi_gdb_exit
59if [mi_gdb_start] {
60 continue
61}
62mi_delete_breakpoints
63mi_gdb_reinitialize_dir $srcdir/$subdir
64mi_gdb_load ${binfile}
65
66# And now try referencing DW_AT_frame_base defined using a self-reference
67# (DW_OP_fbreg).
68if [mi_runto func_loopfb_marker] {
69 mi_gdb_test "301-stack-list-locals --thread 1 --frame 1 --all-values" \
70 "301\\^done,locals=\\\[\{name=\"func_loopfb_var\",value=\"\\\<error reading variable: DWARF-2 expression error: Loop detected.*\"\},\{name=\"func_loopfb_var2\",value=\"\\\<error reading variable: DWARF-2 expression error: Loop detected.*\"\}\\\]" \
71 "test func_loopfb_var"
72}