From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id h9zIOiUT6l90SAAAWB0awg (envelope-from ) for ; Mon, 28 Dec 2020 12:17:25 -0500 Received: by simark.ca (Postfix, from userid 112) id E34F11F0AA; Mon, 28 Dec 2020 12:17: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=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 89DF21E590 for ; Mon, 28 Dec 2020 12:17:25 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 028843858010; Mon, 28 Dec 2020 17:17:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 028843858010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609175845; bh=KXG9f/s+2swicNBXSdF9FRNE2KVLxWj65/iIDd3ueGY=; 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=lw6FSM6F1dW923xZ/ZhcehygKAKmHIAxUAVD+qR8qvImssaire4eKGVULRLbGfEE6 WkXJqyXkjJdrMBiKIj1MO4hdAz4mWsHxBKrkMMEA7cNi5Wli8JBlTiDmaU/HlHHsjJ REnCVUzvvTYWaDe0a2qZPmRPcAv4kWBH7M/zUGc8= Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by sourceware.org (Postfix) with ESMTPS id 1AEC63858010 for ; Mon, 28 Dec 2020 17:17:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1AEC63858010 Received: by mail-qv1-xf2d.google.com with SMTP id d11so5211040qvo.11 for ; Mon, 28 Dec 2020 09:17:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KXG9f/s+2swicNBXSdF9FRNE2KVLxWj65/iIDd3ueGY=; b=spy3Bl+OMwl8/0IBUy2qPIwKNwAWp8LUlRTOC4Z+W9aTuuXMf4IqzUGPJjk4xrk5O3 u+2PHQRne25kC7D3CX5mgdNFlPD69i9W0A6m73QFR0apPklkQ/T6pZvJCdqrKcb8xUIo 760siBBeworMMwPH4xaaCsTP/tY3QOxrnRIjQsjEGRmOXVu+ErvYr7Dj/3lm2cWOsXdM sbjlNVyzZFEdi3kVOZzTGvjtpTgLLxZwkXrS5B5jwIH1EFtnRizh+/+//T/WqFGzpogp DCzFtDXLwiiO8Iaofz24IDTCwrtTdYQXdNG33pA3JSNlh6blka1sH3cJZW/IpPoGKPXh 9//g== X-Gm-Message-State: AOAM5315ebIjfVfCggHIICsoChbwnOOXCz7vFKpDk3zcQ3Sp5Zy2WdUJ zSpL9U9hP9RFcNouM2xk8CSTxw== X-Google-Smtp-Source: ABdhPJybWZQPBq/DrRVeDat2MB4t7FHpEMGryH6vx3H34AO2O6SQcJAMWGwNI4fWVCXuI7ASMZ9rPQ== X-Received: by 2002:ad4:5904:: with SMTP id ez4mr48079474qvb.30.1609175842691; Mon, 28 Dec 2020 09:17:22 -0800 (PST) Received: from ?IPv6:2804:7f0:8284:370e:19e7:527f:e109:2734? ([2804:7f0:8284:370e:19e7:527f:e109:2734]) by smtp.gmail.com with ESMTPSA id 134sm24237728qkh.62.2020.12.28.09.17.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Dec 2020 09:17:22 -0800 (PST) Subject: Re: [PATCH v3 04/24] Unit testing for GDB-side remote memory tagging handling To: Simon Marchi , gdb-patches@sourceware.org References: <20201109170435.15766-1-luis.machado@linaro.org> <20201109170435.15766-5-luis.machado@linaro.org> <5a4134ff-ec19-6621-8314-81035a6d53c1@polymtl.ca> Message-ID: <508be09f-31d5-aaf9-89fb-e05a215ba2ea@linaro.org> Date: Mon, 28 Dec 2020 14:17:18 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <5a4134ff-ec19-6621-8314-81035a6d53c1@polymtl.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Luis Machado via Gdb-patches Reply-To: Luis Machado Cc: david.spickett@linaro.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 12/25/20 2:34 AM, Simon Marchi wrote: > > > 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". > Fixed. >> +{ >> + 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. > Good catch. I've fixed this with a scoped_restore. > Otherwise, LGTM. > > Simon >