Patchwork [1/6] gdb/testsuite/tui: Always dump_screen when asked

login
register
mail settings
Submitter Andrew Burgess
Date Jan. 7, 2020, 11:52 a.m.
Message ID <46c21f67261de4d1129918af411b068512c0ab16.1578397591.git.andrew.burgess@embecosm.com>
Download mbox | patch
Permalink /patch/37234/
State New
Headers show

Comments

Andrew Burgess - Jan. 7, 2020, 11:52 a.m.
The Term::dump_screen routine currently dumps the screen using calls
to 'verbose', this means it will only dump the screen when the
testsuite is running in verbose mode.

However, the Term::dump_screen is most often called when a test fails,
in this case I think it is useful to have the screen dumped even when
we're not in verbose mode.

This commit changes the calls to 'verbose' to be 'verbose -log' so we
always get the screen dump.

gdb/testsuite/ChangeLog:

	* lib/tuiterm.exp (Term::dump_screen): Always dump the screen when
	called.

Change-Id: I5f0a7f5ac2ece04d6fe6e9c5a28ea2a0dda38955
---
 gdb/testsuite/ChangeLog       | 5 +++++
 gdb/testsuite/lib/tuiterm.exp | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
Tom Tromey - Jan. 7, 2020, 6:54 p.m.
>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> The Term::dump_screen routine currently dumps the screen using calls
Andrew> to 'verbose', this means it will only dump the screen when the
Andrew> testsuite is running in verbose mode.

Andrew> However, the Term::dump_screen is most often called when a test fails,
Andrew> in this case I think it is useful to have the screen dumped even when
Andrew> we're not in verbose mode.

Andrew> This commit changes the calls to 'verbose' to be 'verbose -log' so we
Andrew> always get the screen dump.

Andrew> gdb/testsuite/ChangeLog:

Andrew> 	* lib/tuiterm.exp (Term::dump_screen): Always dump the screen when
Andrew> 	called.

Seems reasonable to me.  Thanks.

Tom

Patch

diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index 6f3d41f1ccb..36e034a3639 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -595,10 +595,10 @@  namespace eval Term {
     proc dump_screen {} {
 	variable _rows
 	variable _cols
-	verbose "Screen Dump ($_cols x $_rows):"
+	verbose -log "Screen Dump ($_cols x $_rows):"
 	for {set y 0} {$y < $_rows} {incr y} {
 	    set fmt [format %5d $y]
-	    verbose "$fmt [get_line $y]"
+	    verbose -log "$fmt [get_line $y]"
 	}
     }