public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Fix FAIL in gdb.mi/mi-nsmoribund.exp
@ 2021-10-05 10:54 Tom de Vries
  2021-10-05 13:32 ` Andrew Burgess
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2021-10-05 10:54 UTC (permalink / raw)
  To: gdb-patches

Hi,

Since commit e36788d1354 "[gdb/testsuite] Fix handling of nr_args < 3 in
mi_gdb_test" we run into:
...
PASS: gdb.mi/mi-nsmoribund.exp: print done = 1
Expecting: ^(.*[^M
]+)?([^
]*^M
\*running,thread-id="[0-9]+"^M
\*running,thread-id="[0-9]+"^M
\*running,thread-id="[0-9]+"^M
\*running,thread-id="[0-9]+"^M
\*running,thread-id="[0-9]+"^M
\*running,thread-id="[0-9]+"^M
\*running,thread-id="[0-9]+"^M
\*running,thread-id="[0-9]+"^M
\*running,thread-id="[0-9]+"^M
\*running,thread-id="[0-9]+"[^M
]+[(]gdb[)] ^M
[ ]*)
103-exec-continue --all^M
=library-loaded,id="/lib64/libgcc_s.so.1",target-name="/lib64/libgcc_s.so.1",\
  host-name="/lib64/libgcc_s.so.1",symbols-loaded="0",thread-group="i1",\
  ranges=[{from="0x00007ffff22a5010",to="0x00007ffff22b6365"}]^M
103^running^M
*running,thread-id="5"^M
(gdb) ^M
FAIL: gdb.mi/mi-nsmoribund.exp: 103-exec-continue --all (unexpected output)
...

The regexp expect running messages for all threads, but we only get one for
thread 5.

The test-case uses non-stop mode, and when the exec-continue --all command is
issued, thread 5 is stopped and all other threads are running.  Consequently,
only thread 5 is resumed, and reported as running.

Fix this by updating the regexp.

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/testsuite] Fix FAIL in gdb.mi/mi-nsmoribund.exp

---
 gdb/testsuite/gdb.mi/mi-nsmoribund.exp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
index 58de9591da8..73a8d1ac71b 100644
--- a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
+++ b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
@@ -121,7 +121,11 @@ set re [list \
 	    [string_list_to_regexp " = 1" \\ n {"} \r\n ^ done]]
 set re [join $re ""]
 mi_gdb_test "print done = 1" $re
-mi_gdb_test "103-exec-continue --all" "\[^\n\]*\r\n$running_re"
+
+# Command exec-continue --all attempts to resume all threads, but only
+# thread 5 was stopped, so only that one is reported as running.
+set running_re "\\*running,thread-id=\"5\""
+mi_gdb_test "103-exec-continue --all" "\[^\n\]*\r\n$running_re" \
 
 gdb_expect {
     -re "\\*stopped,reason=\"exited-normally\"" {

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

* Re: [PATCH][gdb/testsuite] Fix FAIL in gdb.mi/mi-nsmoribund.exp
  2021-10-05 10:54 [PATCH][gdb/testsuite] Fix FAIL in gdb.mi/mi-nsmoribund.exp Tom de Vries
@ 2021-10-05 13:32 ` Andrew Burgess
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Burgess @ 2021-10-05 13:32 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

* Tom de Vries <tdevries@suse.de> [2021-10-05 12:54:10 +0200]:

> Hi,
> 
> Since commit e36788d1354 "[gdb/testsuite] Fix handling of nr_args < 3 in
> mi_gdb_test" we run into:
> ...
> PASS: gdb.mi/mi-nsmoribund.exp: print done = 1
> Expecting: ^(.*[^M
> ]+)?([^
> ]*^M
> \*running,thread-id="[0-9]+"^M
> \*running,thread-id="[0-9]+"^M
> \*running,thread-id="[0-9]+"^M
> \*running,thread-id="[0-9]+"^M
> \*running,thread-id="[0-9]+"^M
> \*running,thread-id="[0-9]+"^M
> \*running,thread-id="[0-9]+"^M
> \*running,thread-id="[0-9]+"^M
> \*running,thread-id="[0-9]+"^M
> \*running,thread-id="[0-9]+"[^M
> ]+[(]gdb[)] ^M
> [ ]*)
> 103-exec-continue --all^M
> =library-loaded,id="/lib64/libgcc_s.so.1",target-name="/lib64/libgcc_s.so.1",\
>   host-name="/lib64/libgcc_s.so.1",symbols-loaded="0",thread-group="i1",\
>   ranges=[{from="0x00007ffff22a5010",to="0x00007ffff22b6365"}]^M
> 103^running^M
> *running,thread-id="5"^M
> (gdb) ^M
> FAIL: gdb.mi/mi-nsmoribund.exp: 103-exec-continue --all (unexpected output)
> ...
> 
> The regexp expect running messages for all threads, but we only get one for
> thread 5.
> 
> The test-case uses non-stop mode, and when the exec-continue --all command is
> issued, thread 5 is stopped and all other threads are running.  Consequently,
> only thread 5 is resumed, and reported as running.
> 
> Fix this by updating the regexp.

That seems to make sense.  LGTM.

Thanks,
Andrew


> 
> Tested on x86_64-linux.
> 
> Any comments?
> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Fix FAIL in gdb.mi/mi-nsmoribund.exp
> 
> ---
>  gdb/testsuite/gdb.mi/mi-nsmoribund.exp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
> index 58de9591da8..73a8d1ac71b 100644
> --- a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
> +++ b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
> @@ -121,7 +121,11 @@ set re [list \
>  	    [string_list_to_regexp " = 1" \\ n {"} \r\n ^ done]]
>  set re [join $re ""]
>  mi_gdb_test "print done = 1" $re
> -mi_gdb_test "103-exec-continue --all" "\[^\n\]*\r\n$running_re"
> +
> +# Command exec-continue --all attempts to resume all threads, but only
> +# thread 5 was stopped, so only that one is reported as running.
> +set running_re "\\*running,thread-id=\"5\""
> +mi_gdb_test "103-exec-continue --all" "\[^\n\]*\r\n$running_re" \
>  
>  gdb_expect {
>      -re "\\*stopped,reason=\"exited-normally\"" {

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

end of thread, other threads:[~2021-10-05 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 10:54 [PATCH][gdb/testsuite] Fix FAIL in gdb.mi/mi-nsmoribund.exp Tom de Vries
2021-10-05 13:32 ` 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).