From d2901a8dcc8acbd819512c36798cfeab5d347cf2 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 2 Sep 2025 10:55:02 +0200 Subject: [PATCH] [gdb/testsuite] Fix clean_restart in gdb.tui Fix clean_restart in the test-cases in gdb.tui. Tested on x86_64-linux. --- gdb/testsuite/gdb.tui/compact-source.exp | 2 +- gdb/testsuite/gdb.tui/main-2.exp | 2 +- gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp | 2 +- gdb/testsuite/gdb.tui/tui-disasm-styling.exp | 2 +- gdb/testsuite/gdb.tui/tui-focus.exp | 4 ++-- gdb/testsuite/gdb.tui/tui-layout.exp | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gdb/testsuite/gdb.tui/compact-source.exp b/gdb/testsuite/gdb.tui/compact-source.exp index b050159260c..33d8827164e 100644 --- a/gdb/testsuite/gdb.tui/compact-source.exp +++ b/gdb/testsuite/gdb.tui/compact-source.exp @@ -41,7 +41,7 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { return -1 } -Term::clean_restart 24 80 $binfile +Term::clean_restart 24 80 $testfile gdb_test_no_output "maint set tui-left-margin-verbose on" gdb_test_no_output "set tui compact-source on" diff --git a/gdb/testsuite/gdb.tui/main-2.exp b/gdb/testsuite/gdb.tui/main-2.exp index 14a7cb1e5ac..2bc6b8d978e 100644 --- a/gdb/testsuite/gdb.tui/main-2.exp +++ b/gdb/testsuite/gdb.tui/main-2.exp @@ -26,7 +26,7 @@ if { [build_executable "failed to prepare" $testfile $srcfile ] == -1} { return -1 } -Term::clean_restart 24 80 $binfile +Term::clean_restart 24 80 $testfile if {![runto_main]} { perror "test suppressed" diff --git a/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp b/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp index 35f990d8a20..7a9841fd0c8 100644 --- a/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp +++ b/gdb/testsuite/gdb.tui/tui-disasm-long-lines.exp @@ -35,7 +35,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" \ } } -Term::clean_restart 24 80 $binfile +Term::clean_restart 24 80 $testfile if {![Term::prepare_for_tui]} { unsupported "TUI not supported" return diff --git a/gdb/testsuite/gdb.tui/tui-disasm-styling.exp b/gdb/testsuite/gdb.tui/tui-disasm-styling.exp index 43b8ecf5fb0..685974411df 100644 --- a/gdb/testsuite/gdb.tui/tui-disasm-styling.exp +++ b/gdb/testsuite/gdb.tui/tui-disasm-styling.exp @@ -37,7 +37,7 @@ proc check_asm_output { expect_styled testname } { $testname } -Term::clean_restart 24 80 $binfile +Term::clean_restart 24 80 $testfile if {![Term::enter_tui]} { unsupported "TUI not supported" return diff --git a/gdb/testsuite/gdb.tui/tui-focus.exp b/gdb/testsuite/gdb.tui/tui-focus.exp index 26e5060636e..50a331563cb 100644 --- a/gdb/testsuite/gdb.tui/tui-focus.exp +++ b/gdb/testsuite/gdb.tui/tui-focus.exp @@ -36,7 +36,7 @@ foreach spec {{src true} {cmd true} {status true} {regs false} \ lassign $spec window valid_p with_test_prefix "window=$window" { - Term::clean_restart 24 80 $binfile + Term::clean_restart 24 80 $testfile if {![Term::prepare_for_tui]} { unsupported "TUI not supported" return @@ -75,7 +75,7 @@ foreach spec {{src true} {cmd true} {status true} {regs false} \ # Use the Python TUI API to exercise some of the ambiguous window name # handling parts of the 'focus' command. -Term::clean_restart 24 80 $binfile +Term::clean_restart 24 80 $testfile if {[allow_python_tests]} { # Create a very simple tui window. gdb_py_test_silent_cmd \ diff --git a/gdb/testsuite/gdb.tui/tui-layout.exp b/gdb/testsuite/gdb.tui/tui-layout.exp index 7bb0ea15fed..f6048716a2c 100644 --- a/gdb/testsuite/gdb.tui/tui-layout.exp +++ b/gdb/testsuite/gdb.tui/tui-layout.exp @@ -40,7 +40,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} { # happens to be in after a call to clean_restart. proc test_layout_or_focus {layout_name terminal execution} { - global binfile gdb_prompt + global gdb_prompt set dumb_terminal [string equal $terminal "dumb"] @@ -48,9 +48,9 @@ proc test_layout_or_focus {layout_name terminal execution} { save_vars { env(TERM) } { setenv TERM $terminal if {$dumb_terminal} { - clean_restart $binfile + clean_restart $::testfile } else { - Term::clean_restart 24 80 $binfile + Term::clean_restart 24 80 $::testfile if {![Term::prepare_for_tui]} { unsupported "TUI not supported" return -- 2.47.3