[gdb] Expand symbolless symtabs using maint expand-symtabs
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / maint-expand-symbols-header-file.exp
1 # Copyright 2020 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 # Test-case to verify that symbol-less symtabs are expanded by
17 # "maint expand-symtabs".
18
19 standard_testfile .c
20
21 if {[prepare_for_testing "failed to prepare" $testfile \
22 $srcfile {debug nowarnings}]} {
23 return -1
24 }
25
26 set test "verify no symtabs are expanded"
27 if { [readnow] } {
28 unsupported $test
29 return -1
30 }
31 gdb_test_no_output "maint info symtabs" $test
32
33 # Expand the header file symtab.
34 gdb_test_no_output "maint expand-symtabs maint-expand-symbols-header-file.h"
35
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"
41
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"
This page took 0.029838 seconds and 4 git commands to generate.