1 # Copyright 2013-2016 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/>.
19 # This test can only be run on targets which support DWARF-2 and use gas.
20 if ![dwarf2_support] {
24 # This test can only be run on x86-64 targets.
25 if {![istarget x86_64-*] || ![is_lp64_target]} {
29 if {[prepare_for_testing "$testfile.exp" "$testfile" $srcfile {nodebug}]} {
33 if ![runto "stop_frame"] {
37 # stop_frame should be the outermost frame.
39 # Check that backtrace shows only frame #0.
40 gdb_test "bt" "#0\[ \]\+stop_frame \[^\r\n\]\+"
42 # And that "up" doesn't work.
44 "Initial frame selected; you cannot go up\\." \
47 # "info frame" unwinds the PC for "saved ... = ". Make sure that
48 # doesn't cause an error, and shows "<not saved>".
49 gdb_test "info frame" [multi_line \
50 "Stack level 0, frame at $hex\:" \
51 " rip = $hex in stop_frame \\(dw2-undefined-ret-addr\\.c:22\\); saved rip = <not saved>" \
52 " Outermost frame: outermost" \
53 " source language c\\." \
54 " Arglist at $hex, args\: " \
55 " Locals at $hex, Previous frame's sp is $hex" \
56 " Saved registers\:" \