From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id W8fDOl/CHGAIFAAAWB0awg (envelope-from ) for ; Thu, 04 Feb 2021 22:58:23 -0500 Received: by simark.ca (Postfix, from userid 112) id E3D8B1EFCB; Thu, 4 Feb 2021 22:58:23 -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 5057D1E945 for ; Thu, 4 Feb 2021 22:58:23 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD425393A423; Fri, 5 Feb 2021 03:58:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD425393A423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612497502; bh=olf+Xq5/eojBfKvLSYe5cL4Rom0GE60V5Igg86gIthU=; 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=veanWoeLZFBLhH+VDNJ1mXoUttGRSyR44oriAxdP0FPVzr1KbPeFnW1bya/csO20c xemqvRVbYt5czwygv42uNULaVSK7cHdJXUfIrjbfzYJ6PvZsyVxThaCVRGPR+vn/I7 BEMbO1XI9QghULIxaE5Nwc2n9AJo42VF7G8IoHgo= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id DD6673874C0F for ; Fri, 5 Feb 2021 03:58:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DD6673874C0F 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 1153wExJ029743 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 4 Feb 2021 22:58:19 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1153wExJ029743 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 C418B1E945; Thu, 4 Feb 2021 22:58:14 -0500 (EST) Subject: Re: [PATCH v5 02/25] New gdbarch memory tagging hooks To: Luis Machado , gdb-patches@sourceware.org References: <20210127202112.2485702-1-luis.machado@linaro.org> <20210127202112.2485702-3-luis.machado@linaro.org> Message-ID: <59987d66-39e6-43a2-ca25-dcde580d8d82@polymtl.ca> Date: Thu, 4 Feb 2021 22:58:14 -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-3-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 03:58:15 +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" > +enum memtag_type > +{ > + /* Logical tag, the tag that is stored in unused bits of a pointer to a > + virtual address. */ > + tag_logical = 0, > + > + /* Allocation tag, the tag that is associated with every granule of memory in > + the physical address space. Allocation tags are used to validate memory > + accesses via pointers containing logical tags. */ > + tag_allocation, > +}; Maybe one more suggestion: use enum class. I find that it ends up more self-descriptive when you use it. enum class memtag_type { /* ... */ logical, /* ... */ allocation, }; Without enum class (in C), I always try to prefix the enumerators with the enum type name, to get the same self-decriptiveness (and to avoid name clashes): enum memtag_type { memtag_type_logical, memtag_type_allocation, }; ... but enum class is just cleaner, and safer. Simon