From: Lancelot SIX Date: Tue, 19 Oct 2021 21:44:19 +0000 (+0000) Subject: Add a const version of gdb_argv:as_array_view X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b4195d8d1d1a7c328f9b0dc48cdbf3d8abb6fe6;p=binutils-gdb.git Add a const version of gdb_argv:as_array_view This commits adds const versions for the GET and AS_ARRAX_VIEW methods of gdb_argv. Those methods will be required in the following patch of the series. --- 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 @@ public: return m_argv; } + const char * const * get () const + { + return m_argv; + } + /* Return the underlying array, transferring ownership to the caller. */ @@ -227,6 +232,11 @@ public: 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) {