From patchwork Thu May 3 09:15:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 27076 Received: (qmail 25551 invoked by alias); 3 May 2018 09:16:51 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 123918 invoked by uid 89); 3 May 2018 09:15:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=ACCESS X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 May 2018 09:15:39 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E3B0481A88C3; Thu, 3 May 2018 09:15:35 +0000 (UTC) Received: from host1.jankratochvil.net (unknown [10.36.118.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0568B2024CA1; Thu, 3 May 2018 09:15:34 +0000 (UTC) Date: Thu, 3 May 2018 11:15:32 +0200 From: Jan Kratochvil To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [patch] aarch64: PR 19806: watchpoints: false negatives + PR 20207 contiguous ones Message-ID: <20180503091532.GA3460897@host1.jankratochvil.net> References: <20170327210753.GA29656@host1.jankratochvil.net> <20171018195237.GA19714@host1.jankratochvil.net> <867evczxik.fsf@gmail.com> <20171103220437.GA13979@host1.jankratochvil.net> <20180321190316.GA32598@host1.jankratochvil.net> <1e06eb53-60f4-0800-a4f6-458e02f840bd@redhat.com> <20180426201216.GA218540@host1.jankratochvil.net> <20180501230339.GA3136080@host1.jankratochvil.net> <20180501230606.GA3138797@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180501230606.GA3138797@host1.jankratochvil.net> User-Agent: Mutt/1.9.2 (2017-12-15) Hi, some add-on diff to prevent FAILs on s390x/ppc64/ppc64le/arm32. Jan 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"