1 # Copyright 2024 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 # Test relies on checking gdb debug output. Do not run if gdb debug is
17 # enabled as any debug will be redirected to the log.
18 require !gdb_debug_enabled
20 standard_testfile .c -2.c
21 set srcfiles [list $srcfile $srcfile2]
22 if {[prepare_for_testing "failed to prepare" $testfile $srcfiles]} {
30 # Redirect debug output to file.
31 set logfile [host_standard_output_file gdb.txt]
32 gdb_test_no_output "set logging file $logfile" \
33 "set logging file [file tail $logfile]"
34 gdb_test_no_output "set logging debugredirect on"
35 gdb_test "set logging enabled on"
38 gdb_test "set debug frame 1"
40 # Check that calling info frame doesn't trigger an exception that escapes to
42 set re_locals " Locals at \[^\r\n\]*"
43 set re_regs1 " Saved registers:"
44 set re_reg "\[^ \]+ at $hex"
45 set re_regs2 " $re_reg,( $re_reg,)*"
46 set re_regs3 " ${re_reg}(, $re_reg)*"
53 ($re_regs2\r\n)*$re_regs3]
54 gdb_test "info frame" "\r\n($re1|$re2)"
56 gdb_test_no_output "set debug frame 0"
57 gdb_test "set logging enabled off"