From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zIDWNxWuHGBuEQAAWB0awg (envelope-from ) for ; Thu, 04 Feb 2021 21:31:49 -0500 Received: by simark.ca (Postfix, from userid 112) id D6D201EFCB; Thu, 4 Feb 2021 21:31:49 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 26FF71E945 for ; Thu, 4 Feb 2021 21:31:49 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7A340393D033; Fri, 5 Feb 2021 02:31:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A340393D033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612492308; bh=6VXLFpxEh8hytjg7q+3RLz0+5r+c51WEQkuHq26e1aI=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=uABKsvNSxTUhuoJvq9ekIS/0MS9EzOUarWAiaRaFROr33cPj65P2B1gOMgfMziu5E ZEwApygUtFtKWcgYksSzhj9yKwgmMTGmqox4/qCrDW/msAGmtW+t3oka8qaazQUo/L TKBHUkBIg7pqNt2IEohTVFYkHnS0GH+ePtxlGJRQ= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 16AAB3857C63 for ; Fri, 5 Feb 2021 02:31:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 16AAB3857C63 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 1152VdP6029261 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 4 Feb 2021 21:31:44 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1152VdP6029261 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8A8A51E945; Thu, 4 Feb 2021 21:31:39 -0500 (EST) Subject: Re: [PATCH v5 01/25] New target methods for memory tagging support To: Luis Machado , gdb-patches@sourceware.org References: <20210127202112.2485702-1-luis.machado@linaro.org> <20210127202112.2485702-2-luis.machado@linaro.org> Message-ID: Date: Thu, 4 Feb 2021 21:31:39 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210127202112.2485702-2-luis.machado@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 5 Feb 2021 02:31:39 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-01-27 3:20 p.m., Luis Machado via Gdb-patches wrote: > Updates on v5: > > - Remove the memory_tagging global (in favor of setting a specific print > option) and related functions. > > Updates on v4: > > - Updated the return types of fetch/store member functions from int to bool. > - Implemented target-debug type print helpers. > - Renamed global memtag to memory_tagging. > > Updates on v3: > > - Updated the code documentation for the fetch_memtags and store_memtags > methods. > > Updates on v2: > > - Added type parameter to fetch_memtags/store_memtags hooks. > > -- > > This patch starts adding some of the generic pieces to accomodate memory > tagging. > > We have three new target methods: > > - supports_memory_tagging: Checks if the target supports memory tagging. This > defaults to false for targets that don't support memory tagging. > > - fetch_memtags: Fetches the allocation tags associated with a particular > memory range [address, address + length). > > The default is to return 0 without returning any tags. This should only > be called if memory tagging is supported. > > - store_memtags: Stores a set of allocation tags for a particular memory > range [address, address + length). > > The default is to return 0. This should only > be called if memory tagging is supported. > > gdb/ChangeLog: > > YYYY-MM-DD Luis Machado > > * remote.c (remote_target) : New method > override. > : New method override. > : New method override. > (remote_target::supports_memory_tagging): New method. > (remote_target::fetch_memtags): New method. > (remote_target::store_memtags): New method. > * target-delegates.c: Regenerate. > * target.h (struct target_ops) : New virtual > method. > : New virtual method. > : New virtual method. > (target_supports_memory_tagging): Define. > (target_fetch_memtags): Define. > (target_store_memtags): Define. > * target-debug.h (target_debug_print_size_t) > (target_debug_print_const_gdb_byte_vector_r) > (target_debug_print_gdb_byte_vector_r): New functions. > --- > gdb/remote.c | 34 +++++++++++++++ > gdb/target-debug.h | 24 +++++++++++ > gdb/target-delegates.c | 95 ++++++++++++++++++++++++++++++++++++++++++ > gdb/target.h | 41 ++++++++++++++++++ > 4 files changed, 194 insertions(+) > > diff --git a/gdb/remote.c b/gdb/remote.c > index bc995edc53..b130f1ddae 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -690,6 +690,14 @@ class remote_target : public process_stratum_target > int remove_exec_catchpoint (int) override; > enum exec_direction_kind execution_direction () override; > > + bool supports_memory_tagging () override; > + > + bool fetch_memtags (CORE_ADDR address, size_t len, > + gdb::byte_vector &tags, int type) override; > + > + bool store_memtags (CORE_ADDR address, size_t len, > + const gdb::byte_vector &tags, int type) override; The indentation is a bit off here. Otherwise, LGTM. Simon