Add dwarf2_per_bfd::start_reading
[binutils-gdb.git] / gdb / testsuite / gdb.tui / main.exp
blob4213035fc468e0a9a99a9700bbc5cf0960c89452
1 # Copyright 2019-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 that "file" shows "main".
18 require allow_tui_tests
20 tuiterm_env
22 standard_testfile tui-layout.c
24 if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
25     return -1
28 # Note: don't pass the executable here
29 Term::clean_restart 24 80
31 set line "  return 0;"
32 set nr [gdb_get_line_number $line]
34 # Later on we'd like to avoid having to answer a question.
35 gdb_test_no_output "set interactive-mode off"
37 # Show the left margin using tui-left-margin-verbose.
38 gdb_test_no_output "maint set tui-left-margin-verbose on"
40 if {![Term::enter_tui]} {
41     unsupported "TUI not supported"
42     return
45 send_gdb "file [standard_output_file $testfile]\n"
46 gdb_assert { [Term::wait_for "Reading symbols from"] } "file command"
47 Term::check_contents "show main after file" \
48     [string_to_regexp "|___[format %06d $nr]_$line"]
50 # Ensure that "file" clears the source window.
51 Term::command "file"
52 Term::check_contents "file clears window" "No Source Available"
54 Term::check_region_contents "empty title" \
55     0 0 80 1 {^\+-*\+$}