xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.base/frame-args.exp (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1# Copyright 2007-2016 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
16standard_testfile .c
17if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
18    untested "Couldn't compile ${srcfile}"
19    return -1
20}
21
22clean_restart ${binfile}
23
24if ![runto break_me] then {
25  perror "Couldn't run ${testfile}"
26  return
27}
28
29# Test with "print frame-arguments" set to "all"
30
31gdb_test_no_output "set print frame-arguments all" \
32         "set print frame-arguments all"
33gdb_test "frame 1" \
34         ".*in call_me \\(i=3, f=5, s=({a = 3, b = 5}|<optimized out>), ss=0x\[0-9a-f\]\+, u=({.*}|<optimized out>), e=green\\) at .*frame-args\\.c:.*" \
35         "frame 1 with print frame-arguments set to all"
36
37# Test with "print frame-arguments" set to "scalars"
38
39gdb_test_no_output "set print frame-arguments scalars" \
40         "set print frame-arguments scalars"
41gdb_test "frame 1" \
42         ".*in call_me \\(i=3, f=5, s=\\.\\.\\., ss=0x\[0-9a-f\]\+, u=\\.\\.\\., e=green\\) at .*frame-args\\.c:.*" \
43         "frame 1 with print frame-arguments set to scalars"
44
45# Test with "print frame-arguments" set to "none"
46
47gdb_test_no_output "set print frame-arguments none" \
48         "set print frame-arguments none"
49gdb_test "frame 1" \
50         ".*in call_me \\(i=\\.\\.\\., f=\\.\\.\\., s=\\.\\.\\., ss=\\.\\.\\., u=\\.\\.\\., e=\\.\\.\\.\\) at .*frame-args\\.c:.*" \
51         "frame 1 with print frame-arguments set to none"
52
53
54