From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id CFC7A38582B7 for ; Fri, 14 Oct 2022 18:11:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CFC7A38582B7 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f45.google.com with SMTP id a10so8743756wrm.12 for ; Fri, 14 Oct 2022 11:11:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:mime-version:user-agent :date:message-id:cc:to:subject:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XtB88Fzrx5CnrycD/q32a2cD/rwGFmSdHH5SvXZHi0I=; b=e2M0Da1X2ZsAJhziBp4gLIUmd+t/9OVFSmoAUL5r8xa+kb7CeDDHlStXcVbjU3GsxM UWNnGkITk+0Ziwzh3cMwDoI2ivIDJJS+rWgkwwtRhrliXERAkSzoEatmPVCNQSVsuCnS DT2bki6NLMcPtaVnlFfUEVpTGS3kmS/v3OVCKdO9Fvw34KGB9DR1mjgUYUMDkHpNLvCR lpvoShcsZxZz7AjjDghQDIlZw6XcKUrt8oiJlrmg/cozhTBHtRwmUZmtj65H/F/dAyko VRgrnEXEbQxtTKnBo/dI4yJ3dJhHDuEIMuJITa21HVKacZSnlntI1Wz9BpRUp5juYU0M 4/zA== X-Gm-Message-State: ACrzQf3hFigfkuD4BftxjxF9o6yeSrwvijKg06bCTPZLYxjnqmi5h8yj W/tHlcjjPQixI1doXska3zF6RNoK71pVRQ== X-Google-Smtp-Source: AMsMyM6xafdN3Ms48nWYZIjMV8x4cUZtrSYd1niyzaGZ0X4qxUYT6olHQVO+UekcNJ25f0MJQG306Q== X-Received: by 2002:a05:6000:1885:b0:22e:7869:d43f with SMTP id a5-20020a056000188500b0022e7869d43fmr4230511wri.249.1665771103591; Fri, 14 Oct 2022 11:11:43 -0700 (PDT) Received: from ?IPv6:2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653? ([2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653]) by smtp.gmail.com with ESMTPSA id x8-20020a5d6508000000b00228dff8d975sm2412157wru.109.2022.10.14.11.11.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Oct 2022 11:11:42 -0700 (PDT) From: Pedro Alves Subject: gmp's c++ interface / mpz_class To: gdb@sourceware.org Cc: "Zaric, Zoran (Zare)" Message-ID: Date: Fri, 14 Oct 2022 19:11:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! Zoran and I found a potential need for an integer type with precision of 64-bit + 8-bit, in order to store bit offsets that can span a whole 64-bits address space. Instead of rolling our own, I guess it makes sense to use libgmp, since, well, we already depend on it. I see that we have: /* A class to make it easier to use GMP's mpz_t values within GDB. */ struct gdb_mpz { In gdb/gmp-utils.h. However, we need do to arithmetic on the type, and this wrapper type doesn't implement operator+, operator-, etc, etc. I guess we could add those, as wrappers around mpz_add, etc. Or use raw mpz_add, etc. directly. However, I just found out that GMP already has its own C++ interface: https://gmplib.org/manual/C_002b_002b-Interface-General Before we explore this further, is there an already known reason we shouldn't be using that interface? Pedro Alves