Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / maint-expand-symbols-header-file.exp
CommitLineData
88b9d363 1# Copyright 2020-2022 Free Software Foundation, Inc.
c1a66c06
TV
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
19standard_testfile .c
20
d191d716 21if {[build_executable "failed to prepare" $testfile \
c1a66c06
TV
22 $srcfile {debug nowarnings}]} {
23 return -1
24}
d191d716
TV
25clean_restart
26
27# Make sure that no symtabs are expanded, by setting language before
28# loading exec.
29gdb_test_no_output "set language c"
30gdb_load ${binfile}
c1a66c06
TV
31
32set test "verify no symtabs are expanded"
33if { [readnow] } {
34 unsupported $test
35 return -1
36}
37gdb_test_no_output "maint info symtabs" $test
38
39# Expand the header file symtab.
40gdb_test_no_output "maint expand-symtabs maint-expand-symbols-header-file.h"
41
42# Check that the include symtab was in fact expanded.
43set file_re "\[^\r\n\]*/maint-expand-symbols-header-file.h"
44gdb_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.
49set file_re "\[^\r\n\]*/maint-expand-symbols-header-file.c"
50gdb_test "maint info symtabs" \
51 "\r\n\t{ symtab $file_re \\(\\(struct symtab \\*\\) $hex\\)\r\n.*" \
52 "check source file psymtab expansion"
This page took 0.220582 seconds and 4 git commands to generate.