1 # Copyright 2020 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-case to verify that symbol-less symtabs are expanded by
17 # "maint expand-symtabs".
21 if {[prepare_for_testing "failed to prepare" $testfile \
22 $srcfile {debug nowarnings}]} {
26 set test "verify no symtabs are expanded"
31 gdb_test_no_output "maint info symtabs" $test
33 # Expand the header file symtab.
34 gdb_test_no_output "maint expand-symtabs maint-expand-symbols-header-file.h"
36 # Check that the include symtab was in fact expanded.
37 set file_re "\[^\r\n\]*/maint-expand-symbols-header-file.h"
38 gdb_test "maint info symtabs" \
39 "\r\n\t{ symtab $file_re \\(\\(struct symtab \\*\\) $hex\\)\r\n.*" \
40 "check header file psymtab expansion"
42 # Check that the symtab the include symtab was referring to was expanded.
43 set file_re "\[^\r\n\]*/maint-expand-symbols-header-file.c"
44 gdb_test "maint info symtabs" \
45 "\r\n\t{ symtab $file_re \\(\\(struct symtab \\*\\) $hex\\)\r\n.*" \
46 "check source file psymtab expansion"