1 # Copyright 2018-2019 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/>.
16 # This file is part of the gdb testsuite.
18 # This test was added to test GDB's ability to backtrace over a large
19 # stack frame for which there is no debug information. This should
20 # test the non-DWARF stack unwinder.
22 # The test was originally added for Risc-V where this case caused a
23 # problem at one point, however, there's nothing Risc-V specific in
26 proc run_test { opt_level } {
27 global srcfile srcfile2 binfile hex
29 standard_testfile large-frame-1.c large-frame-2.c
31 if {[prepare_for_testing_full "failed to prepare" \
32 [list ${binfile}-${opt_level} debug \
33 $srcfile [list debug] \
34 $srcfile2 [list nodebug optimize=-$opt_level]]]} {
38 if { ![runto_main] } then {
39 unsupported "runto main"
44 gdb_continue_to_breakpoint "blah"
46 gdb_test "backtrace" [multi_line \
47 "#0 blah \[^\n\r\]+" \
48 "#1 $hex in func \[^\n\r\]+" \
49 "#2 $hex in main \[^\n\r\]+"]
52 foreach opt { O0 O1 O2 } {
53 with_test_prefix "optimize=-$opt" {