From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Yao Qi <qiyaoltc@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [patch] aarch64: PR 19806: watchpoints: false negatives + PR 20207 contiguous ones
Date: Thu, 03 May 2018 09:16:00 -0000 [thread overview]
Message-ID: <20180503091532.GA3460897@host1.jankratochvil.net> (raw)
In-Reply-To: <20180501230606.GA3138797@host1.jankratochvil.net>
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Hi,
some add-on diff to prevent FAILs on s390x/ppc64/ppc64le/arm32.
Jan
[-- Attachment #2: 4 --]
[-- Type: text/plain, Size: 6100 bytes --]
diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.c b/gdb/testsuite/gdb.base/watchpoint-unaligned.c
index 97832a05d4..8934de214e 100644
--- a/gdb/testsuite/gdb.base/watchpoint-unaligned.c
+++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.c
@@ -67,18 +67,25 @@ main (void)
{
switch (size)
{
+/* __s390x__ also defines __s390__ */
+#ifdef __s390__
+# define ACCESS(var) var = ~var
+#else
+# define ACCESS(var) local = var
+#endif
case 8:
- local = data.u.size8[offset];
+ ACCESS (data.u.size8[offset]);
break;
case 4:
- local = data.u.size4[offset];
+ ACCESS (data.u.size4[offset]);
break;
case 2:
- local = data.u.size2[offset];
+ ACCESS (data.u.size2[offset]);
break;
case 1:
- local = data.u.size1[offset];
+ ACCESS (data.u.size1[offset]);
break;
+#undef ACCESS
default:
assert (0);
}
diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
index 25a15a89fd..6bdd4b6d05 100644
--- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp
@@ -32,6 +32,14 @@ gdb_breakpoint [gdb_get_line_number "start_again"] "Breakpoint $decimal at $hex"
set sizes {1 2 4 8}
array set alignedend {1 1 2 2 3 4 4 4 5 8 6 8 7 8 8 8}
+set rwatch "rwatch"
+set rwatch_exp "Hardware read watchpoint"
+if {[istarget "s390*-*-*"]} {
+ # Target does not support this type of hardware watchpoint."
+ set rwatch "watch"
+ set rwatch_exp "Hardware watchpoint"
+}
+
foreach wpsize $sizes {
for {set wpoffset 0} {$wpoffset < 8 / $wpsize} {incr wpoffset} {
set wpstart [expr $wpoffset * $wpsize]
@@ -42,19 +50,26 @@ foreach wpsize $sizes {
set rdstart [expr $rdoffset * $rdsize]
set rdend [expr ($rdoffset + 1) * $rdsize]
set expect_hit [expr max ($wpstart, $rdstart) < min ($wpend, $rdend)]
- set test "rwatch data.u.size$wpsize\[$wpoffset\]"
+ set test "$rwatch data.u.size$wpsize\[$wpoffset\]"
set wpnum ""
gdb_test_multiple $test $test {
- -re "Hardware read watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" {
+ -re "$rwatch_exp (\[0-9\]+): .*\r\n$gdb_prompt $" {
set wpnum $expect_out(1,string)
}
+ -re "Expression cannot be implemented with read/access watchpoint.\r\n$gdb_prompt $" {
+ if {$wpsize == 8 && [istarget "arm*-*-*"]} {
+ untested $test
+ continue
+ }
+ fail $test
+ }
}
gdb_test_no_output "set variable size = $rdsize" ""
gdb_test_no_output "set variable offset = $rdoffset" ""
set test "continue"
set got_hit 0
gdb_test_multiple $test $test {
- -re "Hardware read watchpoint $wpnum:.*Value = .*\r\n$gdb_prompt $" {
+ -re "$rwatch_exp $wpnum:.*alue = .*\r\n$gdb_prompt $" {
set got_hit 1
send_gdb "continue\n"
exp_continue
@@ -72,6 +87,9 @@ foreach wpsize $sizes {
if {$expect_hit == 0 && $rdstart < $wpendaligned} {
setup_xfail external/20207 "aarch64*-*-linux*"
}
+ if {!$expect_hit && [expr max ($wpstart / 8, $rdstart / 8) < min (($wpend + 7) / 8, ($rdend + 7) / 8)]} {
+ setup_xfail breakpoints/23131 "powerpc*-*-*"
+ }
fail $test
}
}
@@ -82,12 +100,20 @@ foreach wpsize $sizes {
foreach wpcount {4 7} {
array set wpoffset_to_wpnum {}
for {set wpoffset 1} {$wpoffset <= $wpcount} {incr wpoffset} {
- set test "rwatch data.u.size1\[$wpoffset\]"
+ set test "$rwatch data.u.size1\[$wpoffset\]"
set wpnum ""
gdb_test_multiple $test $test {
- -re "Hardware read watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" {
+ -re "$rwatch_exp (\[0-9\]+): .*\r\n$gdb_prompt $" {
set wpoffset_to_wpnum($wpoffset) $expect_out(1,string)
}
+ -re "There are not enough available hardware resources for this watchpoint.\r\n$gdb_prompt $" {
+ if {$wpoffset > 1} {
+ setup_xfail breakpoints/23131 "powerpc*-*-*"
+ setup_xfail breakpoints/23131 "arm*-*-*"
+ }
+ fail $test
+ set wpoffset_to_wpnum($wpoffset) 0
+ }
}
}
gdb_test_no_output "set variable size = 1" ""
@@ -97,7 +123,7 @@ foreach wpcount {4 7} {
gdb_test_multiple $test $test {
-re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" {
}
- -re "Hardware read watchpoint $wpoffset_to_wpnum(1):.*Value = .*\r\n$gdb_prompt $" {
+ -re "$rwatch_exp $wpoffset_to_wpnum(1):.*alue = .*\r\n$gdb_prompt $" {
set got_hit 1
send_gdb "continue\n"
exp_continue
@@ -106,11 +132,19 @@ foreach wpcount {4 7} {
}
}
for {set wpoffset 1} {$wpoffset <= $wpcount} {incr wpoffset} {
- gdb_test_no_output "delete $wpoffset_to_wpnum($wpoffset)" ""
+ if {$wpoffset_to_wpnum($wpoffset)} {
+ gdb_test_no_output "delete $wpoffset_to_wpnum($wpoffset)" ""
+ }
}
set test "wpcount($wpcount)"
+ if {!$wpoffset_to_wpnum([expr $wpcount - 1])} {
+ untested $test
+ continue
+ }
if {$wpcount > 4} {
- setup_kfail tdep/22389 *-*-*
+ if {![istarget "s390*-*-*"]} {
+ setup_kfail tdep/22389 *-*-*
+ }
}
gdb_assert $got_hit $test
}
@@ -125,18 +159,26 @@ gdb_test_multiple $test $test {
-re "Hardware watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" {
set wpnum $expect_out(1,string)
}
-}
-set test "continue"
-set got_hit 0
-gdb_test_multiple $test $test {
- -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" {
- }
- -re "Hardware watchpoint $wpnum:.*New value = .*\r\n$gdb_prompt $" {
- set got_hit 1
- send_gdb "continue\n"
- exp_continue
+ -re "Watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" {
+ if {[istarget "arm*-*-*"]} {
+ untested $test
+ set wpnum 0
+ }
}
- -re " final_return .*\r\n$gdb_prompt $" {
+}
+if {$wpnum} {
+ set test "continue"
+ set got_hit 0
+ gdb_test_multiple $test $test {
+ -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" {
+ }
+ -re "Hardware watchpoint $wpnum:.*New value = .*\r\n$gdb_prompt $" {
+ set got_hit 1
+ send_gdb "continue\n"
+ exp_continue
+ }
+ -re " final_return .*\r\n$gdb_prompt $" {
+ }
}
+ gdb_assert $got_hit "size8twice write"
}
-gdb_assert $got_hit "size8twice write"
next prev parent reply other threads:[~2018-05-03 9:16 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-27 21:08 Jan Kratochvil
2017-06-19 13:43 ` ping: " Jan Kratochvil
2017-06-19 13:44 ` Jan Kratochvil
2017-10-18 19:52 ` ping#2: " Jan Kratochvil
2017-10-30 11:27 ` Yao Qi
2017-11-03 22:04 ` Jan Kratochvil
2018-03-21 19:03 ` ping: " Jan Kratochvil
2018-04-20 14:49 ` Pedro Alves
2018-04-20 14:56 ` Pedro Alves
2018-04-20 15:54 ` Eli Zaretskii
2018-04-20 15:59 ` Pedro Alves
2018-04-26 20:12 ` Jan Kratochvil
2018-05-01 23:03 ` Jan Kratochvil
2018-05-01 23:06 ` Jan Kratochvil
2018-05-02 14:50 ` Eli Zaretskii
2018-05-03 9:16 ` Jan Kratochvil [this message]
2018-05-03 9:18 ` Jan Kratochvil
2018-05-04 16:40 ` Pedro Alves
2018-05-04 20:30 ` [commit] " Jan Kratochvil
2018-05-04 20:47 ` Pedro Alves
2018-05-07 8:03 ` Omair Javaid
2018-05-07 8:36 ` Jan Kratochvil
2018-05-08 12:08 ` [patch] " Ulrich Weigand
2018-05-08 12:27 ` [obv] watchpoint-unaligned.exp: Use skip_hw_watchpoint_tests [Re: [patch] aarch64: PR 19806: watchpoints: false negatives + PR 20207 contiguous ones] Jan Kratochvil
2018-05-08 12:45 ` [obv] watchpoint-unaligned.exp: Use skip_hw_watchpoint_tests [Re: [patch] aarch64: PR 19806: watchpoints: false negatives + PR Ulrich Weigand
2017-10-30 11:31 ` ping#2: [patch] aarch64: PR 19806: watchpoints: false negatives + PR 20207 contiguous ones Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180503091532.GA3460897@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox