Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] watchpoint-reuse-slot.exp: Correctly skip unsupported commands.
@ 2014-06-26 13:52 Andreas Arnez
  2014-06-26 14:15 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Arnez @ 2014-06-26 13:52 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

The test case "watchpoint-reuse-slot.exp" yields a lot of failures on
s390/s390x: all instances of awatch, rwatch, and hbreak are performed
even though they aren't supported on these targets.  This is because
the test case ignores non-support error messages when probing for
support of these commands, like:

    (gdb) rwatch buf.byte[0]
    Target does not support this type of hardware watchpoint.

The patch adds handling for this case in the appropriate
gdb_test_multiple invocations.

gdb/testsuite/
	* gdb.base/watchpoint-reuse-slot.exp: Handle the case that the
	target lacks support for watch, awatch, rwatch, or hbreak.
---
 gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index aa30398..46bfd56 100644
--- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
@@ -103,6 +103,9 @@ foreach cmd {"watch" "awatch" "rwatch"} {
 	-re "You may have requested too many.*$gdb_prompt $" {
 	    unsupported $test
 	}
+	-re "Target does not support.*$gdb_prompt $" {
+	    unsupported $test
+	}
 	-re "$gdb_prompt $" {
 	    pass $test
 	    lappend cmds $cmd
@@ -115,7 +118,10 @@ foreach cmd {"watch" "awatch" "rwatch"} {
 set test "hbreak"
 gdb_test_multiple "hbreak main" $test {
     -re "You may have requested too many.*$gdb_prompt $" {
-	pass $test
+	unsupported $test
+    }
+    -re "No hardware breakpoint support.*$gdb_prompt $" {
+	unsupported $test
     }
     -re "$gdb_prompt $" {
 	pass $test
-- 
1.8.4.2


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

* Re: [PATCH] watchpoint-reuse-slot.exp: Correctly skip unsupported commands.
  2014-06-26 13:52 [PATCH] watchpoint-reuse-slot.exp: Correctly skip unsupported commands Andreas Arnez
@ 2014-06-26 14:15 ` Pedro Alves
  2014-06-26 15:21   ` Andreas Arnez
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2014-06-26 14:15 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches

On 06/26/2014 02:52 PM, Andreas Arnez wrote:
> The test case "watchpoint-reuse-slot.exp" yields a lot of failures on
> s390/s390x: all instances of awatch, rwatch, and hbreak are performed
> even though they aren't supported on these targets.  This is because
> the test case ignores non-support error messages when probing for
> support of these commands, like:
> 
>     (gdb) rwatch buf.byte[0]
>     Target does not support this type of hardware watchpoint.
> 
> The patch adds handling for this case in the appropriate
> gdb_test_multiple invocations.

Thank you.

Looks like I only hacked out target_insert_watchpoint/hw_breakpoint
in my testing to return unsupported, which is what leads to the
"You may have requested too many" regexs in place:

 (top-gdb) awatch args.argc
 Hardware access (read/write) watchpoint 4: args.argc
 Warning:
 Could not insert hardware watchpoint 4.
 Could not insert hardware breakpoints:
 You may have requested too many hardware breakpoints/watchpoints.

We get that that error too when debugging against gdbserver with
Z packets disabled, which I also tested.

We get that alternative error if the target_can_use_hw_breakpoint
method returns false, which I forgot to hack/test.

> 
> gdb/testsuite/
> 	* gdb.base/watchpoint-reuse-slot.exp: Handle the case that the
> 	target lacks support for watch, awatch, rwatch, or hbreak.

s/watch, // , I think, as "watch" falls back to software
watchpoints.

Patch is OK.

Thanks!

-- 
Pedro Alves


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

* Re: [PATCH] watchpoint-reuse-slot.exp: Correctly skip unsupported commands.
  2014-06-26 14:15 ` Pedro Alves
@ 2014-06-26 15:21   ` Andreas Arnez
  2014-06-30 11:36     ` Ulrich Weigand
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Arnez @ 2014-06-26 15:21 UTC (permalink / raw)
  To: Pedro Alves, Ulrich Weigand; +Cc: gdb-patches

On Thu, Jun 26 2014, Pedro Alves wrote:

>> gdb/testsuite/
>> 	* gdb.base/watchpoint-reuse-slot.exp: Handle the case that the
>> 	target lacks support for watch, awatch, rwatch, or hbreak.
>
> s/watch, // , I think, as "watch" falls back to software
> watchpoints.

OK.

> Patch is OK.

Good, thanks for reviewing.

Uli, would you push this?  Thanks :-)

-- >8 --
Subject: [PATCH] watchpoint-reuse-slot.exp: Correctly skip unsupported commands.

The test case "watchpoint-reuse-slot.exp" yields a lot of failures on
s390/s390x: all instances of awatch, rwatch, and hbreak are performed
even though they aren't supported on these targets.  This is because
the test case ignores non-support error messages when probing for
support of these commands, like:

    (gdb) rwatch buf.byte[0]
    Target does not support this type of hardware watchpoint.

The patch adds handling for this case in the appropriate
gdb_test_multiple invocations.

gdb/testsuite/
	* gdb.base/watchpoint-reuse-slot.exp: Handle the case that the
	target lacks support for awatch, rwatch, or hbreak.
---
 gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index aa30398..46bfd56 100644
--- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
@@ -103,6 +103,9 @@ foreach cmd {"watch" "awatch" "rwatch"} {
 	-re "You may have requested too many.*$gdb_prompt $" {
 	    unsupported $test
 	}
+	-re "Target does not support.*$gdb_prompt $" {
+	    unsupported $test
+	}
 	-re "$gdb_prompt $" {
 	    pass $test
 	    lappend cmds $cmd
@@ -115,7 +118,10 @@ foreach cmd {"watch" "awatch" "rwatch"} {
 set test "hbreak"
 gdb_test_multiple "hbreak main" $test {
     -re "You may have requested too many.*$gdb_prompt $" {
-	pass $test
+	unsupported $test
+    }
+    -re "No hardware breakpoint support.*$gdb_prompt $" {
+	unsupported $test
     }
     -re "$gdb_prompt $" {
 	pass $test
-- 
1.8.4.2


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

* Re: [PATCH] watchpoint-reuse-slot.exp: Correctly skip unsupported commands.
  2014-06-26 15:21   ` Andreas Arnez
@ 2014-06-30 11:36     ` Ulrich Weigand
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Weigand @ 2014-06-30 11:36 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: Pedro Alves, gdb-patches

Andreas Arnez wrote:
> On Thu, Jun 26 2014, Pedro Alves wrote:
> 
> >> gdb/testsuite/
> >> 	* gdb.base/watchpoint-reuse-slot.exp: Handle the case that the
> >> 	target lacks support for watch, awatch, rwatch, or hbreak.
> >
> > s/watch, // , I think, as "watch" falls back to software
> > watchpoints.
> 
> OK.
> 
> > Patch is OK.
> 
> Good, thanks for reviewing.
> 
> Uli, would you push this?  Thanks :-)

OK, done.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


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

end of thread, other threads:[~2014-06-30 11:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-26 13:52 [PATCH] watchpoint-reuse-slot.exp: Correctly skip unsupported commands Andreas Arnez
2014-06-26 14:15 ` Pedro Alves
2014-06-26 15:21   ` Andreas Arnez
2014-06-30 11:36     ` Ulrich Weigand

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