From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 138CA3858D1E; Wed, 20 Apr 2022 16:28:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 138CA3858D1E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Use array_view for symbol_impls X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 496feb16f855347dbd30fa171a8dc1d97654ae8e X-Git-Newrev: 6bc3c5b438280008315d5e7b49c0ff1c27225cbe Message-Id: <20220420162806.138CA3858D1E@sourceware.org> Date: Wed, 20 Apr 2022 16:28:06 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2022 16:28:06 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6bc3c5b43828= 0008315d5e7b49c0ff1c27225cbe commit 6bc3c5b438280008315d5e7b49c0ff1c27225cbe Author: Tom Tromey Date: Sat Apr 16 12:36:47 2022 -0600 Use array_view for symbol_impls =20 It seemed to me that using array_view for symbol_impls would give a bit more error checking, at least when gdb is built in libstdc++ debug mode. Diff: --- gdb/symtab.c | 2 +- gdb/symtab.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/symtab.c b/gdb/symtab.c index a75492603b8..43a64edab34 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -6502,7 +6502,7 @@ static struct symbol_impl symbol_impl[MAX_SYMBOL_IMPL= S]; /* The globally visible pointer. This is separate from 'symbol_impl' so that it can be const. */ =20 -const struct symbol_impl *symbol_impls =3D &symbol_impl[0]; +gdb::array_view symbol_impls (symbol_impl); =20 /* Make sure we saved enough room in struct symbol. */ =20 diff --git a/gdb/symtab.h b/gdb/symtab.h index 41c8654a5ef..0adedd9841a 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1188,7 +1188,7 @@ enum symbol_subclass_kind SYMBOL_RUST_VTABLE }; =20 -extern const struct symbol_impl *symbol_impls; +extern gdb::array_view symbol_impls; =20 /* This structure is space critical. See space comments at the top. */