From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id EF4263858409 for ; Wed, 20 Oct 2021 20:05:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF4263858409 Received: from Plymouth.lan (unknown [IPv6:2a02:390:9086:0:b54d:5442:bf49:23dd]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id E798684DBE; Wed, 20 Oct 2021 20:05:55 +0000 (UTC) From: Lancelot SIX To: gdb-patches@sourceware.org Cc: Lancelot SIX Subject: [PATCH 1/2] Add a const version of gdb_argv:as_array_view Date: Wed, 20 Oct 2021 21:05:24 +0100 Message-Id: <20211020200525.122108-2-lsix@lancelotsix.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211020200525.122108-1-lsix@lancelotsix.com> References: <20211020200525.122108-1-lsix@lancelotsix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Wed, 20 Oct 2021 20:05:56 +0000 (UTC) X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 20 Oct 2021 20:05:58 -0000 This commit adds a const versions for the gdb_argv::get and the gdb_argv::as_array_view methods. Those methods will be used in the following patch. --- gdb/utils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gdb/utils.h b/gdb/utils.h index f05e6627dca..6f3a70213a4 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -195,6 +195,11 @@ class gdb_argv return m_argv; } + const char * const * get () const + { + return m_argv; + } + /* Return the underlying array, transferring ownership to the caller. */ @@ -227,6 +232,11 @@ class gdb_argv return gdb::array_view (this->get (), this->count ()); } + gdb::array_view as_array_view () const + { + return gdb::array_view (this->get (), this->count ()); + } + /* Append arguments to this array. */ void append (gdb_argv &&other) { -- 2.33.0