]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/readnever.exp
Automatic date update in version.in
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / readnever.exp
1 # Copyright 2016-2024 Free Software Foundation, Inc.
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
16 # See if we have target board readnow.exp or similar. We're using
17 # --readnever, which is not allowed in combination with --readnow.
18 require !readnow
19
20 standard_testfile .c
21
22 if { [build_executable "failed to build" $testfile $srcfile { debug }] == -1 } {
23 untested "couldn't compile ${srcfile}"
24 return -1
25 }
26
27 save_vars { GDBFLAGS } {
28 append GDBFLAGS " --readnever"
29 if { [clean_restart ${binfile}] == -1 } {
30 return -1
31 }
32 }
33
34 if {![runto_main]} {
35 return
36 }
37
38 gdb_test "break fun_three" \
39 "Breakpoint $decimal at $hex"
40
41 gdb_test "continue" \
42 "Breakpoint $decimal, $hex in fun_three \\(\\)"
43
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 \\(\\)" ]
49
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"
54
55 # Test invalid combination of flags.
56 save_vars { GDBFLAGS } {
57 append GDBFLAGS " --readnever --readnow"
58 gdb_exit
59 gdb_spawn
60
61 set test "test readnow and readnever at the same time"
62 gdb_test_multiple "" $test {
63 "'--readnow' and '--readnever' cannot be specified simultaneously" {
64 pass $test
65 set test "expect eof after failure"
66 gdb_test_multiple "" $test {
67 eof {
68 pass $test
69 }
70 }
71 }
72 }
73 }
74
75
76 # Test symbol-file's -readnever option.
77
78 # Restart GDB without the --readnever option.
79 gdb_exit
80 gdb_start
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"
84
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"