Commit | Line | Data |
---|---|---|
32d0add0 | 1 | # Copyright 2013-2015 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/>. | |
15 | load_lib dwarf.exp | |
16 | ||
17 | standard_testfile .S | |
18 | ||
19 | # This test can only be run on targets which support DWARF-2 and use gas. | |
20 | if ![dwarf2_support] { | |
21 | return 0 | |
22 | } | |
23 | ||
24 | # This test can only be run on x86-64 targets. | |
25 | if {![istarget x86_64-*] || ![is_lp64_target]} { | |
26 | return 0 | |
27 | } | |
28 | ||
29 | if {[prepare_for_testing "$testfile.exp" "$testfile" $srcfile {nodebug}]} { | |
30 | return -1 | |
31 | } | |
32 | ||
33 | if ![runto "stop_frame"] { | |
34 | return -1 | |
35 | } | |
36 | ||
37 | # stop_frame should be the outermost frame. | |
38 | ||
39 | # Check that backtrace shows only frame #0. | |
40 | gdb_test "bt" "#0\[ \]\+stop_frame \[^\r\n\]\+" | |
41 | ||
42 | # And that "up" doesn't work. | |
43 | gdb_test "up" \ | |
44 | "Initial frame selected; you cannot go up\\." \ | |
45 | "up refuses to go up" | |
46 | ||
47 | # "info frame" unwinds the PC for "saved ... = ". Make sure that | |
48 | # doesn't cause an error, and shows "<not saved>". | |
3c724c8c | 49 | gdb_test "info frame" [multi_line \ |
782d47df PA |
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\:" \ | |
57 | " rbp at $hex.*" \ | |
3c724c8c | 58 | ] |