From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id HpX4J+kSxV89KwAAWB0awg (envelope-from ) for ; Mon, 30 Nov 2020 10:42:33 -0500 Received: by simark.ca (Postfix, from userid 112) id 975691F0AB; Mon, 30 Nov 2020 10:42:33 -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.0 required=5.0 tests=MAILING_LIST_MULTI 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 EDB281E552 for ; Mon, 30 Nov 2020 10:42:32 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1BA653857C7E; Mon, 30 Nov 2020 15:42:32 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id AA73A385802D for ; Mon, 30 Nov 2020 15:42:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AA73A385802D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (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 4497F1E552; Mon, 30 Nov 2020 10:42:29 -0500 (EST) Subject: Re: [RFA 1/2] Fix TARGET_CHAR_BIT/HOST_CHAR_BIT confusion in gmp-utils.c To: Joel Brobecker , gdb-patches@sourceware.org References: <20201123042711.GA967337@adacore.com> <1606664757-144138-1-git-send-email-brobecker@adacore.com> <1606664757-144138-2-git-send-email-brobecker@adacore.com> From: Simon Marchi Message-ID: Date: Mon, 30 Nov 2020 10:42:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <1606664757-144138-2-git-send-email-brobecker@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-11-29 10:45 a.m., Joel Brobecker wrote: > In a couple of gdb_mpz methods, we are computing the number of > bits in a gdb::array_view of gdb_byte. Since gdb_byte is defined > using a host-side type (see common-types.h), the number of bits > in a gdb_byte should be HOST_CHAR_BIT, not TARGET_CHAR_BIT. Right, and we are not supposed to use TARGET_CHAR_BIT anymore. The same GDB could be debugging targets with different target char bit values, so a build-time constant like TARGET_CHAR_BIT can't work. For those cases, gdbarch_addressable_memory_unit_size should be used instead. Simon