Skip to content
Snippets Groups Projects
Commit 6b81ded4 authored by Tom de Vries's avatar Tom de Vries
Browse files

[gdb/testsuite] Handle USE_TUI in gdb.tui/corefile-run.exp

Once in a while I find myself rewriting a TUI test-case into a non-TUI
test-case, to better understand whether the problem I'm looking at is
related to the TUI or not.

I've got the impression that I've done this sufficiently often that it's worth
committing the non-TUI version, so having just written a non-TUI version of
gdb.tui/corefile-run.exp, let's commit it.

The non-TUI version can be enabled by doing:
...
$ make check "RUNTESTFLAGS=gdb.tui/corefile-run.exp USE_TUI=0"
...

Also remove hard-coding of a source line number.

Tested on x86_64-linux.
parent ed7d5797
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,19 @@ if { ![gdb_gcore_cmd "$core" "save a corefile"] } { ...@@ -40,6 +40,19 @@ if { ![gdb_gcore_cmd "$core" "save a corefile"] } {
return -1 return -1
} }
set src_line "return 0;"
set src_line_nr [gdb_get_line_number $src_line]
set run_re \
"\\\[Inferior $decimal \\\(process $decimal\\\) exited normally\\]"
if { [info exists USE_TUI] && $USE_TUI == 0 } {
clean_restart $testfile
gdb_test "core-file $core" $src_line "load corefile"
gdb_test "run" $run_re "run until the end"
return
}
Term::clean_restart 24 80 $testfile Term::clean_restart 24 80 $testfile
if {![Term::enter_tui]} { if {![Term::enter_tui]} {
unsupported "TUI not supported" unsupported "TUI not supported"
...@@ -51,8 +64,7 @@ gdb_assert {![string match "No Source Available" $text]} \ ...@@ -51,8 +64,7 @@ gdb_assert {![string match "No Source Available" $text]} \
"initial source listing" "initial source listing"
Term::command "core-file $core" Term::command "core-file $core"
Term::check_contents "load corefile" "21 *return 0.*$gdb_prompt .*" Term::check_contents "load corefile" "$src_line_nr *$src_line.*$gdb_prompt .*"
Term::command "run" Term::command "run"
Term::check_contents "run until the end" \ Term::check_contents "run until the end" $run_re
"\\\[Inferior $decimal \\\(process $decimal\\\) exited normally\\]"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment