public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Use array_view for symbol_impls
@ 2022-04-20 16:28 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-04-20 16:28 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6bc3c5b438280008315d5e7b49c0ff1c27225cbe

commit 6bc3c5b438280008315d5e7b49c0ff1c27225cbe
Author: Tom Tromey <tom@tromey.com>
Date:   Sat Apr 16 12:36:47 2022 -0600

    Use array_view for symbol_impls
    
    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_IMPLS];
 /* The globally visible pointer.  This is separate from 'symbol_impl'
    so that it can be const.  */
 
-const struct symbol_impl *symbol_impls = &symbol_impl[0];
+gdb::array_view<const struct symbol_impl> symbol_impls (symbol_impl);
 
 /* Make sure we saved enough room in struct symbol.  */
 
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
 };
 
-extern const struct symbol_impl *symbol_impls;
+extern gdb::array_view<const struct symbol_impl> symbol_impls;
 
 /* This structure is space critical.  See space comments at the top.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-20 16:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 16:28 [binutils-gdb] Use array_view for symbol_impls Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).