From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id BF0D63858D32 for ; Mon, 17 Oct 2022 17:21:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BF0D63858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x12b.google.com with SMTP id a17so6186550ilq.1 for ; Mon, 17 Oct 2022 10:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=x6yYLbIq4XKUDd9i4VkrgGjI/oSrE3un4x4FRcR9YNM=; b=O3Ni1AsXWthMV/sezT2m5X4DUthkj75/7rakfcR0Vk+f86PbAVEOjY8VDnVW1kr0LD nKI1L8oIEyrQ1LJ2UpmSA9ZYPbVFyE1isdcB0q3IYyrnMDGy8z+jii0zHyN41go8c1w1 /PIOA73IrrP9B051mtenw7H7eGNiByhTtgtMuisSVrWyVr814ibTxqRHVctbxe408/oq oh//zKrihpnC7LzhcjkN9BhVQAInYQV7yE2A5umcwrI3EhfSDRSLY4amJkqe//lf16FB Bgwl2q8AB0sI8CoLi6iLVbKvTruxI2qja+y1QezuvMRR0KwEKJHbu+80pAZcbD4l+WJ8 iieA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=x6yYLbIq4XKUDd9i4VkrgGjI/oSrE3un4x4FRcR9YNM=; b=ZyKbfqxzGMAjMlED5EODk4YGf49Rd0Lu98Nrm3hKfKc4vE+EXK94yBNSpV2f/jO03c +F1Nf/UgfVeXVRPBrGMxt9X3UGD3pW8yh1u03OoEhvbB4xAURkXNe97Fr4X5IvhTD9UO QG1ZlfKBqZb9eo82hGmj35tnOdK+bpDfxy4FPKwTMOYGxu+EsxOOa8WwxcZiIK/VyVSu tCiiwFdYszunPRjwNHn3SE8CuEO7hsiKHH7HcYnI/B8WpsxafAi/4iXJU1xrBcySWhKV rAkxni9nA4x+v6BXkcFklA1pOBRNj0TVSQzkI9v4ziVApOyPB6WT/FNd722MyU6INtio LXgw== X-Gm-Message-State: ACrzQf2Dg2H80Heq/15P+SEUyrX7eqI9sdISZnp7QgimDArtW9rgX+tw FqfO1dr+kog9ftb986t6jpYXIA7QTsbPNA== X-Google-Smtp-Source: AMsMyM4o/7lp3P9WiND8KIpZ563hKP5jtJHCu93m9fGsSvjUiNbyARBCTSgDu3lVA5ySRiVdR5HaAQ== X-Received: by 2002:a05:6e02:1889:b0:2fc:3e4:9c5e with SMTP id o9-20020a056e02188900b002fc03e49c5emr5165262ilu.228.1666027313079; Mon, 17 Oct 2022 10:21:53 -0700 (PDT) Received: from murgatroyd (71-211-181-169.hlrn.qwest.net. [71.211.181.169]) by smtp.gmail.com with ESMTPSA id s18-20020a02cc92000000b00363ca583572sm118512jap.158.2022.10.17.10.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 10:21:52 -0700 (PDT) From: Tom Tromey To: Pedro Alves Cc: gdb@sourceware.org, "Zaric, Zoran (Zare)" Subject: Re: gmp's c++ interface / mpz_class References: X-Attribution: Tom Date: Mon, 17 Oct 2022 11:21:51 -0600 In-Reply-To: (Pedro Alves's message of "Fri, 14 Oct 2022 19:11:39 +0100") Message-ID: <87mt9ujrgw.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Pedro" == Pedro Alves writes: Pedro> In gdb/gmp-utils.h. However, we need do to arithmetic on the type, and this wrapper Pedro> type doesn't implement operator+, operator-, etc, etc. I guess we could add those, Pedro> as wrappers around mpz_add, etc. Or use raw mpz_add, etc. directly. However, I just found Pedro> out that GMP already has its own C++ interface: Pedro> https://gmplib.org/manual/C_002b_002b-Interface-General Pedro> Before we explore this further, is there an already known reason we shouldn't be using Pedro> that interface? I feel sure Joel and I have talked about it, but I don't remember what reason there was any more. The warning in the manual is a bit off-putting, though: *Everything described in this chapter is to be considered preliminary and might be subject to incompatible changes if some unforeseen difficulty reveals itself.* Pedro> Not sure yet whether efficiency really matters in practice, but I suspect it does. I'm curious about this as well. FWIW I've occasionally thought about replacing parts of valarith with GMP. That way gdb could more easily support 128-bit integers. Tom