gdb: LoongArch: Improve the handling of atomic sequence
[binutils-gdb.git] / gdb / testsuite / gdb.mi / dw2-ref-missing-frame.exp
blobb91f915f7cf7892ed1a9363dc11535fe0fd47c8f
1 # Copyright 2008-2024 Free Software Foundation, Inc.
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.
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.
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/>.
16 load_lib dwarf.exp
17 # This test can only be run on targets which support DWARF-2 and use gas.
18 load_lib mi-support.exp
19 set MIFLAGS "-i=mi"
21 require dwarf2_support
23 # Clang reorders global assembly labels, placing them all side by side.
24 # This results in having low and high PCs what have the same value for
25 # the CU and all the functions (in my system, they are all 0x1130).  If
26 # this test is rewritten to use the dwarf assembler instead, we can enable
27 # this test with clang again.
28 if {[test_compiler_info {clang-*-*}]} {
29     unsupported "can't generate debug info"
30     return
33 standard_testfile .S dw2-ref-missing-frame-func.c dw2-ref-missing-frame-main.c
34 set objsfile [standard_output_file ${testfile}.o]
35 set objfuncfile [standard_output_file ${testfile}-func.o]
36 set objmainfile [standard_output_file ${testfile}-main.o]
38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $objsfile object {}] != ""
39      || [gdb_compile "${srcdir}/${subdir}/${srcfile2}" $objfuncfile object {}] != ""
40      || [gdb_compile "${srcdir}/${subdir}/${srcfile3}" $objmainfile object {debug}] != ""
41      || [gdb_compile "$objfuncfile $objsfile $objmainfile" $binfile executable {}] != "" } {
42     return -1
45 if {[mi_clean_restart $binfile]} {
46     return
49 if [mi_runto func_nofb_marker] {
50     # First try referencing DW_AT_frame_base which is not defined.
51     mi_gdb_test "300-stack-list-locals --thread 1 --frame 1 --all-values" \
52         "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\\\\\"\\\.\\\>\"\}\\\].*" \
53         "test func_nofb_marker"
56 # GDB could have crashed.
57 if {[mi_clean_restart $binfile]} {
58     return
61 # And now try referencing DW_AT_frame_base defined using a self-reference
62 # (DW_OP_fbreg).
63 if [mi_runto func_loopfb_marker] {
64     mi_gdb_test "301-stack-list-locals --thread 1 --frame 1 --all-values" \
65         "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.*\"\}\\\]" \
66         "test func_loopfb_var"