Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix wp-replication.exp for targets that provide only 1 hw watchpoint
@ 2013-05-24  3:19 Edjunior Barbosa Machado
  2013-05-24  3:26 ` Edjunior Barbosa Machado
  0 siblings, 1 reply; 5+ messages in thread
From: Edjunior Barbosa Machado @ 2013-05-24  3:19 UTC (permalink / raw)
  To: gdb-patches; +Cc: lgustavo

Thanks,
--
Edjunior

gdb/testsuite/ChangeLog
2013-05-24  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>

	* gdb.threads/wp-replication.exp: Fix accounting of hardware watchpoints
	on targets that provide only one hw watchpoint.

---
 gdb/testsuite/gdb.threads/wp-replication.exp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/wp-replication.exp b/gdb/testsuite/gdb.threads/wp-replication.exp
index 8927a43..f73b763 100644
--- a/gdb/testsuite/gdb.threads/wp-replication.exp
+++ b/gdb/testsuite/gdb.threads/wp-replication.exp
@@ -78,6 +78,10 @@ while { $done == 0 } {
     }
   }
 
+  if { $done == 1 } {
+    break
+  }
+
   gdb_test_multiple "continue" "watchpoint created successfully" {
     -re ".*Breakpoint 2, empty_cycle \\(\\).*$gdb_prompt $" {
       incr hwatch_count
-- 
1.7.1


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

* [PATCH] Fix wp-replication.exp for targets that provide only 1 hw watchpoint
  2013-05-24  3:19 [PATCH] Fix wp-replication.exp for targets that provide only 1 hw watchpoint Edjunior Barbosa Machado
@ 2013-05-24  3:26 ` Edjunior Barbosa Machado
  2013-05-24  7:32   ` Luis Machado
  0 siblings, 1 reply; 5+ messages in thread
From: Edjunior Barbosa Machado @ 2013-05-24  3:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: lgustavo

(sorry, my previous message got truncated. Resending...)

Hi,

current wp-replication.exp testcase counts 2 hw watchpoints even when the target
provides only 1 hw watch, resulting in several unexpected errors. Successfully
tested on x86 (with 4 hw watchpoints available) and ppc64 server (with 1 hw
watch), this patch intends to fix this issue. Ok?

Thanks,
--
Edjunior

gdb/testsuite/ChangeLog
2013-05-24  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>

	* gdb.threads/wp-replication.exp: Fix accounting of hardware watchpoints
	on targets that provide only one hw watchpoint.

---
 gdb/testsuite/gdb.threads/wp-replication.exp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/wp-replication.exp b/gdb/testsuite/gdb.threads/wp-replication.exp
index 8927a43..f73b763 100644
--- a/gdb/testsuite/gdb.threads/wp-replication.exp
+++ b/gdb/testsuite/gdb.threads/wp-replication.exp
@@ -78,6 +78,10 @@ while { $done == 0 } {
     }
   }
 
+  if { $done == 1 } {
+    break
+  }
+
   gdb_test_multiple "continue" "watchpoint created successfully" {
     -re ".*Breakpoint 2, empty_cycle \\(\\).*$gdb_prompt $" {
       incr hwatch_count
-- 
1.7.1


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

* Re: [PATCH] Fix wp-replication.exp for targets that provide only 1 hw watchpoint
  2013-05-24  3:26 ` Edjunior Barbosa Machado
@ 2013-05-24  7:32   ` Luis Machado
  2013-05-24  8:11     ` Luis Machado
  0 siblings, 1 reply; 5+ messages in thread
From: Luis Machado @ 2013-05-24  7:32 UTC (permalink / raw)
  To: Edjunior Barbosa Machado; +Cc: gdb-patches

Hi,

On 05/24/2013 05:25 AM, Edjunior Barbosa Machado wrote:
> (sorry, my previous message got truncated. Resending...)
>
> Hi,
>
> current wp-replication.exp testcase counts 2 hw watchpoints even when the target
> provides only 1 hw watch, resulting in several unexpected errors. Successfully
> tested on x86 (with 4 hw watchpoints available) and ppc64 server (with 1 hw
> watch), this patch intends to fix this issue. Ok?

I wonder why it is counting one more watchpoint. Is it not matching the 
output in the exit block here?

   gdb_test_multiple "continue" "watchpoint created successfully" {
     -re ".*Breakpoint 2, empty_cycle \\(\\).*$gdb_prompt $" {
       incr hwatch_count
     }
     -re ".*Could not insert hardware watchpoint.*$gdb_prompt $" {
       set done 1
       break
     }
   }


> diff --git a/gdb/testsuite/gdb.threads/wp-replication.exp b/gdb/testsuite/gdb.threads/wp-replication.exp
> index 8927a43..f73b763 100644
> --- a/gdb/testsuite/gdb.threads/wp-replication.exp
> +++ b/gdb/testsuite/gdb.threads/wp-replication.exp
> @@ -78,6 +78,10 @@ while { $done == 0 } {
>       }
>     }
>
> +  if { $done == 1 } {
> +    break
> +  }
> +
>     gdb_test_multiple "continue" "watchpoint created successfully" {
>       -re ".*Breakpoint 2, empty_cycle \\(\\).*$gdb_prompt $" {
>         incr hwatch_count
>

The additional if block seems to accomplish what the upcoming 
gdb_test_multiple block does. If it is really a matching problem, it 
seems we can fix it in that block instead of a special-case conditional.

Thanks,
Luis


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

* Re: [PATCH] Fix wp-replication.exp for targets that provide only 1 hw watchpoint
  2013-05-24  7:32   ` Luis Machado
@ 2013-05-24  8:11     ` Luis Machado
  2013-05-24 14:03       ` Edjunior Barbosa Machado
  0 siblings, 1 reply; 5+ messages in thread
From: Luis Machado @ 2013-05-24  8:11 UTC (permalink / raw)
  Cc: Edjunior Barbosa Machado, gdb-patches

On 05/24/2013 09:32 AM, Luis Machado wrote:
>> current wp-replication.exp testcase counts 2 hw watchpoints even when
>> the target
>> provides only 1 hw watch, resulting in several unexpected errors.
>> Successfully
>> tested on x86 (with 4 hw watchpoints available) and ppc64 server (with
>> 1 hw
>> watch), this patch intends to fix this issue. Ok?
>
> I wonder why it is counting one more watchpoint. Is it not matching the
> output in the exit block here?

I think i see the problem here. "break" only really jumps out of the 
gdb_test_multiple block instead of breaking, so this would be a problem 
for all targets that do "on the fly" accounting of resources, thus not 
taking the error check leg of the test.

Maybe replace both "break" with "continue". We really just want to reach 
the top of the while loop here to either jump out of the loop or 
continue with it.

What do you think?

Luis


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

* Re: [PATCH] Fix wp-replication.exp for targets that provide only 1 hw watchpoint
  2013-05-24  8:11     ` Luis Machado
@ 2013-05-24 14:03       ` Edjunior Barbosa Machado
  0 siblings, 0 replies; 5+ messages in thread
From: Edjunior Barbosa Machado @ 2013-05-24 14:03 UTC (permalink / raw)
  To: lgustavo; +Cc: gdb-patches

On 05/24/2013 05:10 AM, Luis Machado wrote:
> I think i see the problem here. "break" only really jumps out of the
> gdb_test_multiple block instead of breaking, so this would be a problem
> for all targets that do "on the fly" accounting of resources, thus not
> taking the error check leg of the test.

Thanks Luis for the feedback, I think you've narrowed down the problem.
That happens on targets that do 'on the fly' checking of available
watchpoints (like ppc64 does). It's not a matter of number of available
hw watchpoints as my original message suggests.

> Maybe replace both "break" with "continue". We really just want to reach
> the top of the while loop here to either jump out of the loop or
> continue with it.

'continue' doesn't work either. From what I understood, 'break' or
'continue' will terminate the iteration of the innermost nested loop,
that seems to be the gdb_test_multiple block. That's why it continues to
the second gdb_test_multiple block and wrongly increments hwatch_count
instead of going to the beginning of while block.

-- 
Edjunior


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

end of thread, other threads:[~2013-05-24 14:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-24  3:19 [PATCH] Fix wp-replication.exp for targets that provide only 1 hw watchpoint Edjunior Barbosa Machado
2013-05-24  3:26 ` Edjunior Barbosa Machado
2013-05-24  7:32   ` Luis Machado
2013-05-24  8:11     ` Luis Machado
2013-05-24 14:03       ` Edjunior Barbosa Machado

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