From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wbDvA2LRHGDNFQAAWB0awg (envelope-from ) for ; Fri, 05 Feb 2021 00:02:26 -0500 Received: by simark.ca (Postfix, from userid 112) id 005A61EFCB; Fri, 5 Feb 2021 00:02:25 -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 55D081E939 for ; Fri, 5 Feb 2021 00:02:25 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E42F539D2C7A; Fri, 5 Feb 2021 05:02:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E42F539D2C7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612501344; bh=dS18l+2LsZLppXZoaCTrmCpM3nOE3dmJw7Cx+m79A58=; 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=N403zXoDpsj2eXcbqX6cp7O78yd93/AMrBGAJm42lq8J0sPHD8kxFxW1S83DxPSse khnXHxDDI5hdVYOjH3DmgSaG0sI+pZFKYivZYi3Y5Ijd8abASvOPkz/h/6/KB86sVR qBstlCi9ZvNBFeUoOOWV9j2nf5R0PI7Zpq2ZgzF0= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id D9802389853F for ; Fri, 5 Feb 2021 05:02:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D9802389853F 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 11552G47018017 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 5 Feb 2021 00:02:21 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 11552G47018017 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)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AC9C91E939; Fri, 5 Feb 2021 00:02:16 -0500 (EST) Subject: Re: [PATCH v5 22/25] Extend "x" and "print" commands to support memory tagging To: Luis Machado , gdb-patches@sourceware.org References: <20210127202112.2485702-1-luis.machado@linaro.org> <20210127202112.2485702-23-luis.machado@linaro.org> Message-ID: Date: Fri, 5 Feb 2021 00:02:16 -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-23-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 05:02:16 +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" > @@ -1208,6 +1254,26 @@ print_value (value *val, const value_print_options &opts) > annotate_value_history_end (); > } > > +/* Returns true if memory tags should be validated. False otherwise. */ > + > +static bool > +should_validate_memtags (struct value *value) > +{ > + if (target_supports_memory_tagging () > + && gdbarch_tagged_address_p (target_gdbarch (), value)) > + { > + gdb_assert (value && value_type (value)); != nullptr twice > @@ -3023,6 +3035,16 @@ will be replaced with either '{...}' or '(...)' depending on the language.\n\ > Use \"unlimited\" to print the complete structure.") > }, > > + boolean_option_def { > + "memory-tag-violations", > + [] (value_print_options *opt) { return &opt->memory_tag_violations; }, > + show_memory_tag_violations, /* show_cmd_cb */ > + N_("Set printing of memory tag violations for pointers."), > + N_("Show printing of memory tag violations for pointers."), > + N_("When logical tags in pointers do not match the allocation tags in\n\ > +memory, issue a warning."), Related to what I asked you last time, whether all pointer dereferences made in order to evaluate the value are checked or just the final pointer value: the help message could wrongfully imply that all pointer dereferences are checked and reported, when this isn't the case. Could you spin it as: "Issue a warning when the printed value is a pointer whose logical tag doesn't match the allocation tag of the memory location it points to"? The important part being that it specifies that the printed value is checked. Otherwise, LGTM. Thanks for doing the options change. Simon