From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GAGfDtN55V88TQAAWB0awg (envelope-from ) for ; Fri, 25 Dec 2020 00:34:11 -0500 Received: by simark.ca (Postfix, from userid 112) id 2E4621F0AA; Fri, 25 Dec 2020 00:34:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 6E29D1E590 for ; Fri, 25 Dec 2020 00:34:10 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DE5613858026; Fri, 25 Dec 2020 05:34:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE5613858026 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608874449; bh=uTewOX8E8IaXVNySwtdOUk/YNnUWwd6e6b74PYcRJNU=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=pWAkeYPZKczYSnpupfiw02xJfskSXRE0RNW6PeRmV57kWb4I8IOValhU8lAzfqlMx X4LNUZ9TFFNkQUY1RKErPRHIDsN21h4SYz3mA6uCNoZ4ZckxwedUT1O/PNwIVgoSPq F74kVIIjTf6LezPtOKH8esE2OtU5q8w0tpQPvYSw= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 813723858026 for ; Fri, 25 Dec 2020 05:34:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 813723858026 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 0BP5Y1J4027711 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Dec 2020 00:34:06 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 0BP5Y1J4027711 Received: from [10.0.0.213] (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 2C2C11E590; Fri, 25 Dec 2020 00:34:01 -0500 (EST) Subject: Re: [PATCH v3 04/24] Unit testing for GDB-side remote memory tagging handling To: Luis Machado , gdb-patches@sourceware.org References: <20201109170435.15766-1-luis.machado@linaro.org> <20201109170435.15766-5-luis.machado@linaro.org> Message-ID: <5a4134ff-ec19-6621-8314-81035a6d53c1@polymtl.ca> Date: Fri, 25 Dec 2020 00:34:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20201109170435.15766-5-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, 25 Dec 2020 05:34:01 +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 Cc: david.spickett@linaro.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-11-09 12:04 p.m., Luis Machado via Gdb-patches wrote: > Updated in v2: > > - Adjusted unit tests to cope with new type field in the remote packets. > > -- > > Include some unit testing for the functions handling the new qMemTags and > QMemTags packets. > > gdb/ChangeLog: > > YYYY-MM-DD Luis Machado > > * remote: Include gdbsupport/selftest.h. > (test_memory_tagging_functions): New function. > (_initialize_remote): Register test_memory_tagging_functions. > --- > gdb/remote.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 89 insertions(+) > > diff --git a/gdb/remote.c b/gdb/remote.c > index e45eef4bee..6db7a74542 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -79,6 +79,7 @@ > #include > #include > #include "async-event.h" > +#include "gdbsupport/selftest.h" > > /* The remote target. */ > > @@ -14529,6 +14530,89 @@ remote_target::store_memtags (CORE_ADDR address, size_t len, > return 0; > } > > +#if GDB_SELF_TEST > + > +namespace selftests { > + > +static void > +test_memory_tagging_functions (void) Remove "void". > +{ > + remote_target remote; > + > + struct packet_config *config > + = &remote_protocol_packets[PACKET_memory_tagging_feature]; > + > + /* Test memory tagging packet support. */ > + config->support = PACKET_SUPPORT_UNKNOWN; > + SELF_CHECK (remote.supports_memory_tagging () == false); > + config->support = PACKET_DISABLE; > + SELF_CHECK (remote.supports_memory_tagging () == false); > + config->support = PACKET_ENABLE; > + SELF_CHECK (remote.supports_memory_tagging () == true); This seems to set the global flag of whether the remote side supports memory tagging. Even though it's not likely to be a real problem, IWBN to restore the global state that you touch. Otherwise, LGTM. Simon