Commit | Line | Data |
---|---|---|
c1a66c06 TV |
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 | ||
d191d716 | 21 | if {[build_executable "failed to prepare" $testfile \ |
c1a66c06 TV |
22 | $srcfile {debug nowarnings}]} { |
23 | return -1 | |
24 | } | |
d191d716 TV |
25 | clean_restart |
26 | ||
27 | # Make sure that no symtabs are expanded, by setting language before | |
28 | # loading exec. | |
29 | gdb_test_no_output "set language c" | |
30 | gdb_load ${binfile} | |
c1a66c06 TV |
31 | |
32 | set test "verify no symtabs are expanded" | |
33 | if { [readnow] } { | |
34 | unsupported $test | |
35 | return -1 | |
36 | } | |
37 | gdb_test_no_output "maint info symtabs" $test | |
38 | ||
39 | # Expand the header file symtab. | |
40 | gdb_test_no_output "maint expand-symtabs maint-expand-symbols-header-file.h" | |
41 | ||
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" | |
47 | ||
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" |