public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Fix FAIL in gdb.tui/corefile-run.exp
@ 2021-10-05 11:42 Tom de Vries
  2021-10-06  8:57 ` Andrew Burgess
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2021-10-05 11:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Hi,

When running test-case gdb.tui/corefile-run.exp on openSUSE Tumbleweed,
I run into:
...
PASS: gdb.tui/corefile-run.exp: load corefile
FAIL: gdb.tui/corefile-run.exp: run until the end
...

What's going on is easier to see when also doing dump_screen if
check_contents passes, and inspecting state at the preceding PASS:
...
 +-------------------------------------------------------------------------+
 exec No process In:                                           L??   PC: ??
 [New LWP 16629]
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib64/libthread_db.so.1".
 Core was generated by `/data/gdb_versions/devel/build/gdb/testsuite/output
 s/gdb.tui/corefile-run/corefi'.
 Program terminated with signal SIGTRAP, Trace/breakpoint trap.
 #0  main ()
 --Type <RET> for more, q to quit, c to continue without paging--
...

The problem is that we're getting a pagination prompt, and the subsequent run
command is interpreted as an answer to that prompt.

Fix this by:
- detecting the gdb prompt in response to "load corefile", such that
  we detect the failure earlier, and
- doing a "set pagination off" in Term::clean_restart.

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/testsuite] Fix FAIL in gdb.tui/corefile-run.exp

---
 gdb/testsuite/gdb.tui/corefile-run.exp | 2 +-
 gdb/testsuite/lib/tuiterm.exp          | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.tui/corefile-run.exp b/gdb/testsuite/gdb.tui/corefile-run.exp
index f000ff6a93a..d3eaaaf4af9 100644
--- a/gdb/testsuite/gdb.tui/corefile-run.exp
+++ b/gdb/testsuite/gdb.tui/corefile-run.exp
@@ -54,7 +54,7 @@ gdb_assert {![string match "No Source Available" $text]} \
     "initial source listing"
 
 Term::command "core-file $core"
-Term::check_contents "load corefile" "21 *return 0"
+Term::check_contents "load corefile" "21 *return 0.*$gdb_prompt .*"
 
 Term::command "run"
 Term::check_contents "run until the end" \
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index 222583f291f..ad5cbb72ea5 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -595,6 +595,7 @@ namespace eval Term {
 	    } else {
 		::clean_restart $executable
 	    }
+	    ::gdb_test_no_output "set pagination off"
 	}
     }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][gdb/testsuite] Fix FAIL in gdb.tui/corefile-run.exp
  2021-10-05 11:42 [PATCH][gdb/testsuite] Fix FAIL in gdb.tui/corefile-run.exp Tom de Vries
@ 2021-10-06  8:57 ` Andrew Burgess
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Burgess @ 2021-10-06  8:57 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches, Tom Tromey

* Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> [2021-10-05 13:42:14 +0200]:

> Hi,
> 
> When running test-case gdb.tui/corefile-run.exp on openSUSE Tumbleweed,
> I run into:
> ...
> PASS: gdb.tui/corefile-run.exp: load corefile
> FAIL: gdb.tui/corefile-run.exp: run until the end
> ...
> 
> What's going on is easier to see when also doing dump_screen if
> check_contents passes, and inspecting state at the preceding PASS:
> ...
>  +-------------------------------------------------------------------------+
>  exec No process In:                                           L??   PC: ??
>  [New LWP 16629]
>  [Thread debugging using libthread_db enabled]
>  Using host libthread_db library "/lib64/libthread_db.so.1".
>  Core was generated by `/data/gdb_versions/devel/build/gdb/testsuite/output
>  s/gdb.tui/corefile-run/corefi'.
>  Program terminated with signal SIGTRAP, Trace/breakpoint trap.
>  #0  main ()
>  --Type <RET> for more, q to quit, c to continue without paging--
> ...
> 
> The problem is that we're getting a pagination prompt, and the subsequent run
> command is interpreted as an answer to that prompt.
> 
> Fix this by:
> - detecting the gdb prompt in response to "load corefile", such that
>   we detect the failure earlier, and
> - doing a "set pagination off" in Term::clean_restart.
> 
> Tested on x86_64-linux.
> 
> Any comments?

LGTM.

Thanks,
Andrew

> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Fix FAIL in gdb.tui/corefile-run.exp
> 
> ---
>  gdb/testsuite/gdb.tui/corefile-run.exp | 2 +-
>  gdb/testsuite/lib/tuiterm.exp          | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.tui/corefile-run.exp b/gdb/testsuite/gdb.tui/corefile-run.exp
> index f000ff6a93a..d3eaaaf4af9 100644
> --- a/gdb/testsuite/gdb.tui/corefile-run.exp
> +++ b/gdb/testsuite/gdb.tui/corefile-run.exp
> @@ -54,7 +54,7 @@ gdb_assert {![string match "No Source Available" $text]} \
>      "initial source listing"
>  
>  Term::command "core-file $core"
> -Term::check_contents "load corefile" "21 *return 0"
> +Term::check_contents "load corefile" "21 *return 0.*$gdb_prompt .*"
>  
>  Term::command "run"
>  Term::check_contents "run until the end" \
> diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
> index 222583f291f..ad5cbb72ea5 100644
> --- a/gdb/testsuite/lib/tuiterm.exp
> +++ b/gdb/testsuite/lib/tuiterm.exp
> @@ -595,6 +595,7 @@ namespace eval Term {
>  	    } else {
>  		::clean_restart $executable
>  	    }
> +	    ::gdb_test_no_output "set pagination off"
>  	}
>      }
>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-06  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 11:42 [PATCH][gdb/testsuite] Fix FAIL in gdb.tui/corefile-run.exp Tom de Vries
2021-10-06  8:57 ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).