From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 785113858C74; Sun, 6 Feb 2022 21:08:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 785113858C74 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: rename compunit_primary_filetab to compunit_symtab::primary_filetab X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 9821f3fa56de3e2c13c234357421ae1839ce27f7 X-Git-Newrev: 0b17a4f78fb969e7c1ae298561ef6963c73006a7 Message-Id: <20220206210847.785113858C74@sourceware.org> Date: Sun, 6 Feb 2022 21:08:47 +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: Sun, 06 Feb 2022 21:08:47 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D0b17a4f78fb9= 69e7c1ae298561ef6963c73006a7 commit 0b17a4f78fb969e7c1ae298561ef6963c73006a7 Author: Simon Marchi Date: Fri Nov 19 20:50:59 2021 -0500 gdb: rename compunit_primary_filetab to compunit_symtab::primary_filetab =20 Make compunit_primary_filetab a method of compunit_symtab. =20 Change-Id: Iee3c4f7e36d579bf763c5bba146e5e10d6766768 Diff: --- gdb/dwarf2/read.c | 2 +- gdb/guile/scm-block.c | 2 +- gdb/psymtab.c | 2 +- gdb/symfile-debug.c | 6 +++--- gdb/symmisc.c | 2 +- gdb/symtab.c | 10 +++++----- gdb/symtab.h | 8 +++----- 7 files changed, 15 insertions(+), 17 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index fe274ed3a1f..84877e6c7fe 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -3113,7 +3113,7 @@ dwarf2_base_index_functions::find_last_source_symtab = (struct objfile *objfile) if (cust =3D=3D NULL) return NULL; =20 - return compunit_primary_filetab (cust); + return cust->primary_filetab (); } =20 /* See read.h. */ diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index 0c63dfb25f8..df0ef7f0b1f 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -554,7 +554,7 @@ bkscm_print_block_syms_progress_smob (SCM self, SCM por= t, : i_smob->iter.d.compunit_symtab->includes[i_smob->iter.idx]); gdbscm_printf (port, " %s", symtab_to_filename_for_display - (compunit_primary_filetab (cust))); + (cust->primary_filetab ())); break; } case FIRST_LOCAL_BLOCK: diff --git a/gdb/psymtab.c b/gdb/psymtab.c index ce077c67cbb..fcbf54ab2bd 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -631,7 +631,7 @@ psymbol_functions::find_last_source_symtab (struct objf= ile *ofp) =20 if (cust =3D=3D NULL) return NULL; - return compunit_primary_filetab (cust); + return cust->primary_filetab (); } } return NULL; diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index ab5fc0d0272..cd25789ba9b 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -289,7 +289,7 @@ objfile::lookup_symbol (block_enum kind, const char *na= me, domain_enum domain) if (debug_symfile) fprintf_filtered (gdb_stdlog, "qf->lookup_symbol (...) =3D %s\n", retval - ? debug_symtab_name (compunit_primary_filetab (retval)) + ? debug_symtab_name (retval->primary_filetab ()) : "NULL"); =20 return retval; @@ -454,7 +454,7 @@ objfile::find_pc_sect_compunit_symtab (struct bound_min= imal_symbol msymbol, fprintf_filtered (gdb_stdlog, "qf->find_pc_sect_compunit_symtab (...) =3D %s\n", retval - ? debug_symtab_name (compunit_primary_filetab (retval)) + ? debug_symtab_name (retval->primary_filetab ()) : "NULL"); =20 return retval; @@ -495,7 +495,7 @@ objfile::find_compunit_symtab_by_address (CORE_ADDR add= ress) fprintf_filtered (gdb_stdlog, "qf->find_compunit_symtab_by_address (...) =3D %s\n", result - ? debug_symtab_name (compunit_primary_filetab (result)) + ? debug_symtab_name (result->primary_filetab ()) : "NULL"); =20 return result; diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 19c387d852d..8b57434e84f 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -860,7 +860,7 @@ maintenance_check_symtabs (const char *ignore, int from= _tty) for (compunit_symtab *cust : objfile->compunits ()) { int found_something =3D 0; - struct symtab *symtab =3D compunit_primary_filetab (cust); + struct symtab *symtab =3D cust->primary_filetab (); =20 QUIT; =20 diff --git a/gdb/symtab.c b/gdb/symtab.c index 44b5bfb43bb..2028e837f0f 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -362,12 +362,12 @@ compunit_symtab::set_call_site_htab (htab_t call_site= _htab) /* See symtab.h. */ =20 struct symtab * -compunit_primary_filetab (const struct compunit_symtab *cust) +compunit_symtab::primary_filetab () const { - gdb_assert (COMPUNIT_FILETABS (cust) !=3D NULL); + gdb_assert (this->filetabs !=3D nullptr); =20 /* The primary file symtab is the first one in the list. */ - return COMPUNIT_FILETABS (cust); + return this->filetabs; } =20 /* See symtab.h. */ @@ -375,7 +375,7 @@ compunit_primary_filetab (const struct compunit_symtab = *cust) enum language compunit_language (const struct compunit_symtab *cust) { - struct symtab *symtab =3D compunit_primary_filetab (cust); + struct symtab *symtab =3D cust->primary_filetab (); =20 /* The language of the compunit symtab is the language of its primary source file. */ @@ -2376,7 +2376,7 @@ Internal: %s symbol `%s' found in %s psymtab but not = in symtab.\n\ (if a template, try specifying an instantiation: %s)."), block_index =3D=3D GLOBAL_BLOCK ? "global" : "static", name, - symtab_to_filename_for_display (compunit_primary_filetab (cust)), + symtab_to_filename_for_display (cust->primary_filetab ()), name, name); } =20 diff --git a/gdb/symtab.h b/gdb/symtab.h index dc15c49ec8e..f6d787c45c8 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1459,6 +1459,9 @@ struct compunit_symtab m_objfile =3D objfile; } =20 + /* Return the primary filetab of the compunit. */ + symtab *primary_filetab () const; + /* Set m_call_site_htab. */ void set_call_site_htab (htab_t call_site_htab); =20 @@ -1566,11 +1569,6 @@ compunit_filetabs (compunit_symtab *cu) return symtab_range (cu->filetabs); } =20 -/* Return the primary symtab of CUST. */ - -extern struct symtab * - compunit_primary_filetab (const struct compunit_symtab *cust); - /* Return the language of CUST. */ =20 extern enum language compunit_language (const struct compunit_symtab *cust= );