Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.tui / corefile-run.exp
1 # Copyright 2019-2022 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 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
21 tuiterm_env
22
23 standard_testfile tui-layout.c
24
25 set core "${testfile}.core"
26
27 if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
28 return -1
29 }
30
31 # Only run on native boards.
32 if { [use_gdb_stub] || [target_info gdb_protocol] == "extended-remote" } {
33 untested "not supported"
34 return
35 }
36
37 if { ![runto_main] } {
38 untested "could not run to main"
39 return -1
40 }
41
42 if { ![gdb_gcore_cmd "$core" "save a corefile"] } {
43 untested "could not generate a corefile"
44 return -1
45 }
46
47 Term::clean_restart 24 80 $testfile
48 if {![Term::enter_tui]} {
49 unsupported "TUI not supported"
50 return
51 }
52
53 set text [Term::get_all_lines]
54 gdb_assert {![string match "No Source Available" $text]} \
55 "initial source listing"
56
57 Term::command "core-file $core"
58 Term::check_contents "load corefile" "21 *return 0"
59
60 Term::command "run"
61 Term::check_contents "run until the end" \
62 "\\\[Inferior $decimal \\\(process $decimal\\\) exited normally\\]"
This page took 0.031503 seconds and 4 git commands to generate.