From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101015 invoked by alias); 7 Jun 2016 13:41:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 100889 invoked by uid 89); 7 Jun 2016 13:41:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=yes,no,unknown, negatives, watchpoints, inaccurate X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 07 Jun 2016 13:41:07 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7205146208; Tue, 7 Jun 2016 13:41:05 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u57Df2xu004675; Tue, 7 Jun 2016 09:41:03 -0400 Subject: Re: [patch] aarch64: PR 19806: watchpoints: false negatives -> false positives To: Yao Qi , Jan Kratochvil References: <20160606075945.GA19395@host1.jankratochvil.net> <86eg89w2sr.fsf@gmail.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <48622de4-dc45-c48f-7172-495b669f2334@redhat.com> Date: Tue, 07 Jun 2016 13:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <86eg89w2sr.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-06/txt/msg00132.txt.bz2 On 06/07/2016 02:23 PM, Yao Qi wrote: > this leads me thinking that why do we need to get "inaccurate address" > from target_stopped_data_address, and pass it to > target_watchpoint_addr_within_range. Instead, we can pass the > watchpoint to the (new) target hook, and set > watchpoint.watchpoint_triggered in different target implementations. In > each target implementation, we can set .watchpoint_triggered to > watch_triggered_{yes,no,unknown} according to its hardware feature or > capability. > > I'll give a try this way. How do you plan on handling remote targets though? Done that way, it sounds to me like the alignment restrictions should either be a gdbarch property, or you need some RSP extension, e.g., extend the "watch" stop reply to indicate an stop data address range instead of a sole address, or make the stub report back the alignment restriction when GDB tells it to insert the watchpoint in the first place, instead of just saying "OK". A gdbarch method poses problems for remote stubs that are actually emulators, and thus can support hardware watchpoints without these restrictions. I think it's actually problematic for real machines, as the restrictions will often depend on process revisions/models. So a gdbarch approach would be undesirable, IMO. An RSP extension approach would work, though exactly because it needs some extension, I'm not sure is worth it. See: https://sourceware.org/bugzilla/show_bug.cgi?id=19806#c1 Thanks, Pedro Alves