1 # Copyright 2021-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/>.
18 standard_testfile main.c
20 if {[prepare_for_testing "failed to prepare" "${testfile}" \
21 [list ${srcfile}] {nodebug}]} {
25 set have_index [have_index $binfile]
28 "Error while writing index for \[^\r\n\]*:" \
29 "Cannot use an index to create the index"]
30 set have_index_re [join $have_index_re]
33 "Error while writing index for \[^\r\n\]*:" \
34 "No debugging symbols"]
35 set no_debug_re [join $no_debug_re]
36 set readnow_p [readnow]
38 set index_file ${testfile}.gdb-index
39 # The bug was that gdb would crash here.
40 set cmd "save gdb-index [file dirname ${index_file}]"
41 gdb_test_multiple $cmd "try to save gdb index" {
42 -re -wrap $have_index_re {
43 if { $have_index != "" || $readnow_p } {
44 unsupported $gdb_test_name
49 -re -wrap $no_debug_re {