Allow re-assigning to convenience variables
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.ada / frame_arg_lang.exp
1 # Copyright 2018-2019 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 standard_ada_testfile bla
19 set cfile "foo"
20 set csrcfile ${srcdir}/${subdir}/${testdir}/${cfile}.c
21 set cobject [standard_output_file ${cfile}.o]
22
23 gdb_compile "${csrcfile}" "${cobject}" object [list debug]
24 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-largs additional_flags=${cobject} additional_flags=-margs]] != "" } {
25 return -1
26 }
27
28 clean_restart ${testfile}
29
30 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.c]
31 runto "foo.c:$bp_location"
32
33 gdb_test_no_output "set print frame-arguments all"
34
35 # Here is the scenario:
36 # - Once stopped in a C function, with language_mode set to auto, print
37 # backtrace, we should see the Ada frame arguments printed using Ada
38 # syntax.
39 # - Set language to C, then check that printing backtrace shows the Ada
40 # frame arguments using C syntax.
41 # - Set language back to auto, check language mode value, then print
42 # backtrace, we should see Ada frame arguments printed using Ada C
43 # syntax.
44
45 gdb_test "show lang" \
46 "The current source language is \"auto; currently c\"." \
47 "show language when set to 'auto; c'"
48
49 gdb_test "bt" \
50 "#1 $hex in pck\\.call_me \\(s=\"test\"\\).*" \
51 "backtrace with auto: c"
52
53 gdb_test_no_output "set language c" \
54 "Set current source language to \"manual; currently c\"."
55
56 gdb_test "show lang" \
57 "The current source language is \"c\"." \
58 "show language when set to 'c'"
59
60 gdb_test "bt" \
61 "#1 $hex in pck\\.call_me \\(s={P_ARRAY = $hex, P_BOUNDS = $hex}\\).*" \
62 "backtrace with language forced to 'c'"
63
64 gdb_test_no_output "set language auto" \
65 "Set current source language to \"auto; currently c\"."
66
67 gdb_test "show lang" \
68 "The current source language is \"auto; currently c\"." \
69 "show language when set back to 'auto; c'"
70
71 gdb_test "bt" \
72 "#1 $hex in pck\\.call_me \\(s=\"test\"\\).*" \
73 "backtrace with language back to 'auto; c'"
This page took 0.031005 seconds and 4 git commands to generate.