Update copyright year range in header of all files managed by GDB
[binutils-gdb.git] / gdb / testsuite / gdb.base / large-frame.exp
blob8578418a45f6504da1f4107ad9ab4e7e8f62b039
1 # Copyright 2018-2023 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 if { [is_remote host] } {
19     gdb_remote_download host $srcdir/$subdir/large-frame.h
22 # This test was added to test GDB's ability to backtrace over a large
23 # stack frame for which there is no debug information.  This should
24 # test the non-DWARF stack unwinder.
26 # The test was originally added for Risc-V where this case caused a
27 # problem at one point, however, there's nothing Risc-V specific in
28 # the test.
30 proc run_test { opt_level } {
31     global srcfile srcfile2 binfile hex
33     standard_testfile large-frame-1.c large-frame-2.c
35     if {[prepare_for_testing_full "failed to prepare" \
36              [list ${binfile}-${opt_level} debug \
37                   $srcfile [list debug] \
38                   $srcfile2 [list nodebug optimize=-$opt_level]]]} {
39         return
40     }
42     if {![runto_main]} {
43         return
44     }
46     gdb_breakpoint "blah"
47     gdb_continue_to_breakpoint "blah"
49     gdb_test "backtrace" [multi_line \
50                               "#0  blah \[^\n\r\]+" \
51                               "#1  $hex in func \[^\n\r\]+" \
52                               "#2  $hex in main \[^\n\r\]+"]
55 foreach opt { O0 O1 O2 } {
56     with_test_prefix "optimize=-$opt" {
57         run_test $opt
58     }