From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12472 invoked by alias); 8 Dec 2017 12:22:51 -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 12462 invoked by uid 89); 8 Dec 2017 12:22:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= 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 ESMTP; Fri, 08 Dec 2017 12:22:49 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1F9D2D0FB8; Fri, 8 Dec 2017 12:22:48 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 279B360BEC; Fri, 8 Dec 2017 12:22:47 +0000 (UTC) Subject: Re: [PATCH 2/3] Adjust breakpoint address by clearing non-significant bits To: Yao Qi , gdb-patches@sourceware.org References: <1512727471-30745-1-git-send-email-yao.qi@linaro.org> <1512727471-30745-3-git-send-email-yao.qi@linaro.org> From: Pedro Alves Message-ID: <69bc7bd3-7b20-5dba-ed4f-9d124a84a42d@redhat.com> Date: Fri, 08 Dec 2017 12:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1512727471-30745-3-git-send-email-yao.qi@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-12/txt/msg00180.txt.bz2 On 12/08/2017 10:04 AM, Yao Qi wrote: > When program hits a breakpoint, the stopped pc reported by Linux kernel is > the address *without* tag, so it is better the address recorded in > breakpoint location is the one without tag too, so we can still match > breakpoint location address and stopped pc reported by Linux kernel, by > simple compare. > Agreed. LGTM with formatting nit below. > 2017-10-24 Yao Qi > > * gdb.arch/aarch64-tagged-pointer.c (main): Update. > * gdb.arch/aarch64-tagged-pointer.exp: Add test for breakpoint. > --- > gdb/breakpoint.c | 20 +++++++++---------- > gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c | 8 ++++++++ > gdb/testsuite/gdb.arch/aarch64-tagged-pointer.exp | 24 +++++++++++++++++++++++ > 3 files changed, 42 insertions(+), 10 deletions(-) > > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index 76bfd53..22b3069 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -6987,12 +6987,7 @@ static CORE_ADDR > adjust_breakpoint_address (struct gdbarch *gdbarch, > CORE_ADDR bpaddr, enum bptype bptype) > { > - if (!gdbarch_adjust_breakpoint_address_p (gdbarch)) > - { > - /* Very few targets need any kind of breakpoint adjustment. */ > - return bpaddr; > - } > - else if (bptype == bp_watchpoint > + if (bptype == bp_watchpoint > || bptype == bp_hardware_watchpoint > || bptype == bp_read_watchpoint > || bptype == bp_access_watchpoint Please indent the rest of the condition before pushing. OK with that fixed. > @@ -7014,11 +7009,16 @@ adjust_breakpoint_address (struct gdbarch *gdbarch, > } > else Thanks, Pedro Alves