]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.tui/corefile-run.exp
Update copyright year range in all GDB files
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.tui / corefile-run.exp
CommitLineData
3666a048 1# Copyright 2019-2021 Free Software Foundation, Inc.
494409bb
SDJ
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 whether we can load a corefile, enable TUI and then invoke
17# "run" without having a segfault.
18#
19# Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1765117
20
8c74a764 21tuiterm_env
494409bb
SDJ
22
23standard_testfile tui-layout.c
24
25set core "${testfile}.core"
26
27if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
28 return -1
29}
30
31# Only run on native boards.
32if { [use_gdb_stub] || [target_info gdb_protocol] == "extended-remote" } {
33 untested "not supported"
34 return
35}
36
37if { ![runto_main] } {
38 untested "could not run to main"
39 return -1
40}
41
42if { ![gdb_gcore_cmd "$core" "save a corefile"] } {
43 untested "could not generate a corefile"
44 return -1
45}
46
47Term::clean_restart 24 80 $testfile
48if {![Term::enter_tui]} {
49 unsupported "TUI not supported"
581bea2c 50 return
494409bb
SDJ
51}
52
53set text [Term::get_all_lines]
54gdb_assert {![string match "No Source Available" $text]} \
55 "initial source listing"
56
57Term::command "core-file $core"
58Term::check_contents "load corefile" "21 *return 0"
59
60Term::command "run"
61Term::check_contents "run until the end" \
62 "\\\[Inferior $decimal \\\(process $decimal\\\) exited normally\\]"