]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw2-undefined-ret-addr.exp
CommitLineData
1d506c26 1# Copyright 2013-2024 Free Software Foundation, Inc.
782d47df
PA
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/>.
15load_lib dwarf.exp
16
17standard_testfile .S
18
19# This test can only be run on targets which support DWARF-2 and use gas.
ce8d533e 20require dwarf2_support
782d47df
PA
21
22# This test can only be run on x86-64 targets.
4fe960e8 23require is_x86_64_m64_target
782d47df 24
ea946b86 25if {[prepare_for_testing "failed to prepare" "$testfile" $srcfile {nodebug nopie}]} {
782d47df
PA
26 return -1
27}
28
29if ![runto "stop_frame"] {
30 return -1
31}
32
33# stop_frame should be the outermost frame.
34
35# Check that backtrace shows only frame #0.
36gdb_test "bt" "#0\[ \]\+stop_frame \[^\r\n\]\+"
37
38# And that "up" doesn't work.
39gdb_test "up" \
40 "Initial frame selected; you cannot go up\\." \
41 "up refuses to go up"
42
43# "info frame" unwinds the PC for "saved ... = ". Make sure that
44# doesn't cause an error, and shows "<not saved>".
3c724c8c 45gdb_test "info frame" [multi_line \
782d47df
PA
46 "Stack level 0, frame at $hex\:" \
47 " rip = $hex in stop_frame \\(dw2-undefined-ret-addr\\.c:22\\); saved rip = <not saved>" \
48 " Outermost frame: outermost" \
49 " source language c\\." \
50 " Arglist at $hex, args\: " \
51 " Locals at $hex, Previous frame's sp is $hex" \
52 " Saved registers\:" \
53 " rbp at $hex.*" \
3c724c8c 54]