From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48330 invoked by alias); 9 Nov 2017 21:09:56 -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 47970 invoked by uid 89); 9 Nov 2017 21:09:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=171109, H*r:sk:clients, H*r:sk:static., agent X-HELO: mail-wm0-f67.google.com Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Nov 2017 21:09:54 +0000 Received: by mail-wm0-f67.google.com with SMTP id n74so3631748wmi.1 for ; Thu, 09 Nov 2017 13:09:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=B7jIykXOLVvF7ZdvhezfLoiGG996WjVrCZfcAbxsC9o=; b=j9OvHOLs2v6NcMOm7Z40ngcAnof/cjaeqGXIoR2i5aNJ32nro+A8Gp1XnLqoV06ezR gO965dFlZC4VYCETqoT2I+sx3Kmg7luF1pDZ9ULZhEP4NaBXOB8mCvhpmwgFQoL/hlQ1 End8NrwOgP7F3yPlSeONtmZkKX+0BZPMzvW/HtBBt0090ZBHhekl9NfTdjwj+JQIH+Zy sm3ZGOgKE1xD5VaW9gnrMPmdfeq+fzQGoF0JkvPwhx0f4EpahlLQCjgk10iLfVWEIVjL tkd8FSe3BUOqZOslogaquGO2NhJE5PD1XCYD89Ed6eXrWyzl6Y56vleD3rDxeYM6XAs2 q2Fg== X-Gm-Message-State: AJaThX4539fPaGt9NSRL9p1HdxTB5SRaY6dmk8OnMZ5im5NVFBa6FyOp VK4o/9//AuBun4PP61u0snE= X-Google-Smtp-Source: ABhQp+R4oJMMGw7z+tiAewQBLvPVpNzP7GxFoUkI4s6htswEkrh8omL513ZioEOFP+vTIm+9cGbU7A== X-Received: by 10.80.172.162 with SMTP id x31mr2491774edc.253.1510261792777; Thu, 09 Nov 2017 13:09:52 -0800 (PST) Received: from 1170ee0b50d5 (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id b36sm7079613edd.67.2017.11.09.13.09.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 13:09:52 -0800 (PST) Date: Thu, 09 Nov 2017 21:09:00 -0000 From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/3] [AArch64] Remove tag from address for watchpoint Message-ID: <20171109210950.GD318@1170ee0b50d5> References: <1509006590-9401-1-git-send-email-yao.qi@linaro.org> <1509006590-9401-4-git-send-email-yao.qi@linaro.org> <2fe62186-f1db-cf5c-f0e2-c18e35089dd9@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2fe62186-f1db-cf5c-f0e2-c18e35089dd9@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00212.txt.bz2 On 17-11-09 20:30:42, Pedro Alves wrote: > And then at places where we need to save or compare memory addresses, > like in the watchpoint location addresses case we strip out / ignore > non-significant bits. > > And the next question is: if you're adding a gdbarch hook such as > this one (either significant_addr_bit or addr_tag_remove) > why not use it for all the cases handled by the different patches in > this series, instead of using different solutions for each case? > I.e., for memory access, saving breakpoint and watchpoint > location addresses, the dcache, and any other future case we run > into, like e.g., maybe agent expressions. I thought about this, using this new added gdbarch method everywhere. The reason I didn't do that is due to breakpoint location address comparison (I think I can use the new gdbarch method for the rest, watchpoint location and dcache). As I wrote in patch #2, > When program hits a breakpoint, the stopped pc reported by Linux kernle 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. I did try the different approach, that is keep the tag in > the address saved in the breakpoint location, but I need to change many > places of "loc->address == pc", so I give up on this way. I remember code pattern "loc->address == pc" exists many places in breakpoint.c. I can give a try again. -- Yao (齐尧)