1 # Copyright 2016-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 # See if we have target board readnow.exp or similar. We're using
17 # --readnever, which is not allowed in combination with --readnow.
22 if { [build_executable "failed to build" $testfile $srcfile { debug }] == -1 } {
23 untested "couldn't compile ${srcfile}"
27 save_vars { GDBFLAGS } {
28 append GDBFLAGS " --readnever"
29 if { [clean_restart ${binfile}] == -1 } {
38 gdb_test "break fun_three" \
39 "Breakpoint $decimal at $hex"
42 "Breakpoint $decimal, $hex in fun_three \\(\\)"
44 gdb_test "backtrace" \
45 [multi_line "#0 $hex in fun_three \\(\\)" \
46 "#1 $hex in fun_two \\(\\)" \
47 "#2 $hex in fun_one \\(\\)" \
48 "#3 $hex in main \\(\\)" ]
50 gdb_test_no_output "maint info symtabs" \
51 "maint info symtabs no output for --readnever"
52 gdb_test_no_output "maint info psymtabs" \
53 "maint info psymtabs no output for --readnever"
55 # Test invalid combination of flags.
56 save_vars { GDBFLAGS } {
57 append GDBFLAGS " --readnever --readnow"
61 set test "test readnow and readnever at the same time"
62 gdb_test_multiple "" $test {
63 "'--readnow' and '--readnever' cannot be specified simultaneously" {
65 set test "expect eof after failure"
66 gdb_test_multiple "" $test {
76 # Test symbol-file's -readnever option.
78 # Restart GDB without the --readnever option.
81 gdb_test "symbol-file ${binfile}0.o -readnever" \
82 "Reading symbols from ${binfile}0\.o\.\.\.\r\n\\\(No debugging symbols found in .*\\\)" \
83 "use symbol-file -readnever"
85 gdb_test_no_output "maint info symtabs" \
86 "maint info symtabs no output for symbol-file -readnever"
87 gdb_test_no_output "maint info psymtabs" \
88 "maint info psymtabs no output for symbol-file -readnever"