1 # Copyright 2020-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-case to verify that symbol-less symtabs are expanded by
17 # "maint expand-symtabs".
21 if {[build_executable "failed to prepare" $testfile \
22 $srcfile {debug nowarnings}]} {
27 # Make sure that no symtabs are expanded, by setting language before
29 gdb_test_no_output "set language c"
32 set test "verify no symtabs are expanded"
37 gdb_test_no_output "maint info symtabs" $test
39 # Expand the header file symtab.
40 gdb_test_no_output "maint expand-symtabs maint-expand-symbols-header-file.h"
42 # Check that the include symtab was in fact expanded.
43 set file_re "\[^\r\n\]*maint-expand-symbols-header-file.h"
44 gdb_test "maint info symtabs" \
45 "\r\n\t{ symtab $file_re \\(\\(struct symtab \\*\\) $hex\\)\r\n.*" \
46 "check header file psymtab expansion"
48 # Check that the symtab the include symtab was referring to was expanded.
49 set file_re "\[^\r\n\]*maint-expand-symbols-header-file.c"
50 gdb_test "maint info symtabs" \
51 "\r\n\t{ symtab $file_re \\(\\(struct symtab \\*\\) $hex\\)\r\n.*" \
52 "check source file psymtab expansion"