Update copyright year range in all GDB files
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.ada / frame_arg_lang.exp
1 # Copyright 2018-2021 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 load_lib "ada.exp"
17
18 if { [skip_ada_tests] } { return -1 }
19
20 standard_ada_testfile bla
21 set cfile "foo"
22 set csrcfile ${srcdir}/${subdir}/${testdir}/${cfile}.c
23 set cobject [standard_output_file ${cfile}.o]
24
25 gdb_compile "${csrcfile}" "${cobject}" object [list debug]
26
27 # Note we don't test the "none" (no -fgnat-encodings option) scenario
28 # here, because "all" and "minimal" cover the cases, and this way we
29 # don't have to update the test when gnat changes its default.
30 foreach_with_prefix scenario {all minimal} {
31 set flags [list debug additional_flags=-largs \
32 additional_flags=${cobject} \
33 additional_flags=-margs \
34 additional_flags=-fgnat-encodings=$scenario]
35
36 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} {
37 return -1
38 }
39
40 clean_restart ${testfile}
41
42 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.c]
43 runto "foo.c:$bp_location"
44
45 gdb_test_no_output "set print frame-arguments all"
46
47 # Here is the scenario:
48 # - Once stopped in a C function, with language_mode set to auto, print
49 # backtrace, we should see the Ada frame arguments printed using Ada
50 # syntax.
51 # - Set language to C, then check that printing backtrace shows the Ada
52 # frame arguments using C syntax.
53 # - Set language back to auto, check language mode value, then print
54 # backtrace, we should see Ada frame arguments printed using Ada C
55 # syntax.
56
57 gdb_test "show lang" \
58 "The current source language is \"auto; currently c\"." \
59 "show language when set to 'auto; c'"
60
61 gdb_test "bt" \
62 "#1 $hex in pck\\.call_me \\(s=\"test\"\\).*" \
63 "backtrace with auto: c"
64
65 gdb_test_no_output "set language c" \
66 "Set current source language to \"manual; currently c\"."
67
68 gdb_test "show lang" \
69 "The current source language is \"c\"." \
70 "show language when set to 'c'"
71
72 gdb_test "bt" \
73 "#1 $hex in pck\\.call_me \\(s={P_ARRAY = $hex, P_BOUNDS = $hex}\\).*" \
74 "backtrace with language forced to 'c'"
75
76 gdb_test_no_output "set language auto" \
77 "Set current source language to \"auto; currently c\"."
78
79 gdb_test "show lang" \
80 "The current source language is \"auto; currently c\"." \
81 "show language when set back to 'auto; c'"
82
83 gdb_test "bt" \
84 "#1 $hex in pck\\.call_me \\(s=\"test\"\\).*" \
85 "backtrace with language back to 'auto; c'"
86 }
This page took 0.040843 seconds and 4 git commands to generate.