Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb.base/async.exp: Handle "asynchronous execution not supported"
@ 2015-12-08  6:23 Kevin Buettner
  2015-12-08  8:01 ` Joel Brobecker
  2015-12-08 10:01 ` Pedro Alves
  0 siblings, 2 replies; 6+ messages in thread
From: Kevin Buettner @ 2015-12-08  6:23 UTC (permalink / raw)
  To: gdb-patches

This change eliminates some failures on simulator targets and makes
the test run a bit quicker too - without this change, we have to wait
for timeouts.

gdb/testsuite/ChangeLog:
    
    	* gdb.base/async.exp (proc test_background): Add case
    	for asynchronous execution not supported.
---
 gdb/testsuite/gdb.base/async.exp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp
index 2d3fb73..8226244 100644
--- a/gdb/testsuite/gdb.base/async.exp
+++ b/gdb/testsuite/gdb.base/async.exp
@@ -61,6 +61,9 @@ proc test_background {command before_prompt after_prompt {message ""}} {
 	-re "$gdb_prompt.*completed\.\r\n" {
 	    fail "$message"
 	}
+	-re ".*Asynchronous execution not supported on this target..*" {
+	    unsupported "Asynchronous execution not supported: $message"
+	}
 	timeout  {
 	    fail "$message (timeout)"
 	}


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

* Re: [PATCH] gdb.base/async.exp: Handle "asynchronous execution not supported"
  2015-12-08  6:23 [PATCH] gdb.base/async.exp: Handle "asynchronous execution not supported" Kevin Buettner
@ 2015-12-08  8:01 ` Joel Brobecker
  2015-12-08 20:17   ` Kevin Buettner
  2015-12-08 10:01 ` Pedro Alves
  1 sibling, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2015-12-08  8:01 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Hi Kevin,

> gdb/testsuite/ChangeLog:
>     
>     	* gdb.base/async.exp (proc test_background): Add case
>     	for asynchronous execution not supported.

You might want to escape the period you're trying to match
at the end of the sentence. Other than that, LGTM.

Looking at this, would it be possible in this case to replace
the send_gdb/gdb_expect into test_gdb_multiple? I'm not really
sure, because of the async nature makes ordering of the output
relative to the gdb_prompt different from usual, and thus perhaps
outside the scope of what test_gdb_multiple is capable of doing...

Thanks!

> ---
>  gdb/testsuite/gdb.base/async.exp | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp
> index 2d3fb73..8226244 100644
> --- a/gdb/testsuite/gdb.base/async.exp
> +++ b/gdb/testsuite/gdb.base/async.exp
> @@ -61,6 +61,9 @@ proc test_background {command before_prompt after_prompt {message ""}} {
>  	-re "$gdb_prompt.*completed\.\r\n" {
>  	    fail "$message"
>  	}
> +	-re ".*Asynchronous execution not supported on this target..*" {
> +	    unsupported "Asynchronous execution not supported: $message"
> +	}
>  	timeout  {
>  	    fail "$message (timeout)"
>  	}

-- 
Joel


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

* Re: [PATCH] gdb.base/async.exp: Handle "asynchronous execution not supported"
  2015-12-08  6:23 [PATCH] gdb.base/async.exp: Handle "asynchronous execution not supported" Kevin Buettner
  2015-12-08  8:01 ` Joel Brobecker
@ 2015-12-08 10:01 ` Pedro Alves
  1 sibling, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2015-12-08 10:01 UTC (permalink / raw)
  To: Kevin Buettner, gdb-patches

On 12/08/2015 06:22 AM, Kevin Buettner wrote:
> This change eliminates some failures on simulator targets and makes
> the test run a bit quicker too - without this change, we have to wait
> for timeouts.
> 
> gdb/testsuite/ChangeLog:
>     
>     	* gdb.base/async.exp (proc test_background): Add case
>     	for asynchronous execution not supported.
> ---
>  gdb/testsuite/gdb.base/async.exp | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp
> index 2d3fb73..8226244 100644
> --- a/gdb/testsuite/gdb.base/async.exp
> +++ b/gdb/testsuite/gdb.base/async.exp
> @@ -61,6 +61,9 @@ proc test_background {command before_prompt after_prompt {message ""}} {
>  	-re "$gdb_prompt.*completed\.\r\n" {
>  	    fail "$message"
>  	}
> +	-re ".*Asynchronous execution not supported on this target..*" {
> +	    unsupported "Asynchronous execution not supported: $message"
> +	}

Could you handle the suggestion here too, please?

 https://sourceware.org/ml/gdb-patches/2015-06/msg00519.html

>  	timeout  {
>  	    fail "$message (timeout)"
>  	}
> 


Thanks,
Pedro Alves


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

* Re: [PATCH] gdb.base/async.exp: Handle "asynchronous execution not supported"
  2015-12-08  8:01 ` Joel Brobecker
@ 2015-12-08 20:17   ` Kevin Buettner
  2015-12-09 10:13     ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Buettner @ 2015-12-08 20:17 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker, Pedro Alves

On Tue, 8 Dec 2015 09:01:24 +0100
Joel Brobecker <brobecker@adacore.com> wrote:

> You might want to escape the period you're trying to match
> at the end of the sentence. Other than that, LGTM.

Fixed in new patch.  (See below.)

I've addressed Pedro's concerns too.

> Looking at this, would it be possible in this case to replace
> the send_gdb/gdb_expect into test_gdb_multiple? I'm not really
> sure, because of the async nature makes ordering of the output
> relative to the gdb_prompt different from usual, and thus perhaps
> outside the scope of what test_gdb_multiple is capable of doing...

I don't know the answer to this either.  I'll defer to someone
who knows more about this than I do.

Here's an updated patch...

    gdb.base/async.exp: Handle "asynchronous execution not supported"
    
    This change eliminates some failures on simulator targets and makes
    the test run a bit quicker too - without this change, we have to wait
    for timeouts.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.base/async.exp (proc test_background): Add case
    	for asynchronous execution not supported.
---
 gdb/testsuite/gdb.base/async.exp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp
index 2d3fb73..6546bbc 100644
--- a/gdb/testsuite/gdb.base/async.exp
+++ b/gdb/testsuite/gdb.base/async.exp
@@ -57,17 +57,24 @@ proc test_background {command before_prompt after_prompt {message ""}} {
     gdb_expect {
 	-re "^$command\r\n${before_prompt}${gdb_prompt}${after_prompt}completed\.\r\n" {
 	    pass "$message"
+	    return 0
 	}
 	-re "$gdb_prompt.*completed\.\r\n" {
 	    fail "$message"
 	}
+	-re ".*Asynchronous execution not supported on this target\..*" {
+	    unsupported "Asynchronous execution not supported: $message"
+	}
 	timeout  {
 	    fail "$message (timeout)"
 	}
     }
+    return -1
 }
 
-test_background "next&" "" ".*z = 9.*"
+if {[test_background "next&" "" ".*z = 9.*"] < 0} {
+    return
+}
 
 test_background "step&" "" ".*y = foo \\(\\).*" "step& #1"
 


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

* Re: [PATCH] gdb.base/async.exp: Handle "asynchronous execution not supported"
  2015-12-08 20:17   ` Kevin Buettner
@ 2015-12-09 10:13     ` Pedro Alves
  2015-12-09 16:28       ` Kevin Buettner
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2015-12-09 10:13 UTC (permalink / raw)
  To: Kevin Buettner, gdb-patches; +Cc: Joel Brobecker

On 12/08/2015 08:17 PM, Kevin Buettner wrote:
> On Tue, 8 Dec 2015 09:01:24 +0100
> Joel Brobecker <brobecker@adacore.com> wrote:
> 
>> You might want to escape the period you're trying to match
>> at the end of the sentence. Other than that, LGTM.
> 
> Fixed in new patch.  (See below.)
> 
> I've addressed Pedro's concerns too.
> 

Thanks, LGTM.

>> Looking at this, would it be possible in this case to replace
>> the send_gdb/gdb_expect into test_gdb_multiple? I'm not really
>> sure, because of the async nature makes ordering of the output
>> relative to the gdb_prompt different from usual, and thus perhaps
>> outside the scope of what test_gdb_multiple is capable of doing...
> 
> I don't know the answer to this either.  I'll defer to someone
> who knows more about this than I do.

I think I recall trying gdb_test_multiple for 884e37dc, but not sure.
The prompt matching within gdb_test_multiple will definitely be the
thing to watch out for.

> 
> Here's an updated patch...
> 

Thanks,
Pedro Alves


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

* Re: [PATCH] gdb.base/async.exp: Handle "asynchronous execution not supported"
  2015-12-09 10:13     ` Pedro Alves
@ 2015-12-09 16:28       ` Kevin Buettner
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Buettner @ 2015-12-09 16:28 UTC (permalink / raw)
  To: gdb-patches

On Wed, 09 Dec 2015 10:13:07 +0000
Pedro Alves <palves@redhat.com> wrote:

> On 12/08/2015 08:17 PM, Kevin Buettner wrote:
> >
> > Fixed in new patch.  (See below.)
> > 
> > I've addressed Pedro's concerns too.
> > 
> 
> Thanks, LGTM.

Pushed.

Thanks again (to both you and Joel) for looking it over.

Kevin


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

end of thread, other threads:[~2015-12-09 16:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08  6:23 [PATCH] gdb.base/async.exp: Handle "asynchronous execution not supported" Kevin Buettner
2015-12-08  8:01 ` Joel Brobecker
2015-12-08 20:17   ` Kevin Buettner
2015-12-09 10:13     ` Pedro Alves
2015-12-09 16:28       ` Kevin Buettner
2015-12-08 10:01 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox