public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Use array_view for symbol_impls
Date: Wed, 20 Apr 2022 16:28:06 +0000 (GMT)	[thread overview]
Message-ID: <20220420162806.138CA3858D1E@sourceware.org> (raw)

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.  */


                 reply	other threads:[~2022-04-20 16:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220420162806.138CA3858D1E@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).