From patchwork Thu May 10 22:23:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27230 Received: (qmail 71521 invoked by alias); 10 May 2018 22:25:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 42070 invoked by uid 89); 10 May 2018 22:24:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=sk:start_p X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.49.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 May 2018 22:24:07 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway20.websitewelcome.com (Postfix) with ESMTP id A0C17400CC251 for ; Thu, 10 May 2018 17:24:05 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id GtynfKoQrWCOCGtynfCesi; Thu, 10 May 2018 17:24:05 -0500 X-Authority-Reason: nr=8 Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:54520 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fGtyn-001ijL-E2; Thu, 10 May 2018 17:24:05 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 03/15] Remove parameters from start_psymtab_common Date: Thu, 10 May 2018 16:23:45 -0600 Message-Id: <20180510222357.27332-4-tom@tromey.com> In-Reply-To: <20180510222357.27332-1-tom@tromey.com> References: <20180510222357.27332-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fGtyn-001ijL-E2 X-Source-Sender: 97-122-176-117.hlrn.qwest.net (bapiya.Home) [97.122.176.117]:54520 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes start_psymtab_common takes references to the global_psymbols and static_psymbols vectors, but it also has an objfile parameter. This is redundant, so this patch simplifies the function by removing those reference parameters. 2018-05-09 Tom Tromey * xcoffread.c (xcoff_start_psymtab): Remove global_psymbols and static_psymbols parameters. (scan_xcoff_symtab): Update. * psymtab.c (start_psymtab_common): Remove global_psymbols and static_psymbols parameters. * psympriv.h (start_psymtab_common): Update. * mdebugread.c (parse_partial_symbols): Update. * dwarf2read.c (create_partial_symtab): Update. * dbxread.c (read_dbx_symtab): Update. (start_psymtab): Remove global_psymbols and static_psymbols parameters. --- gdb/ChangeLog | 14 ++++++++++++++ gdb/dbxread.c | 14 ++++---------- gdb/dwarf2read.c | 4 +--- gdb/mdebugread.c | 4 +--- gdb/psympriv.h | 4 +--- gdb/psymtab.c | 8 +++----- gdb/xcoffread.c | 15 ++++----------- 7 files changed, 28 insertions(+), 35 deletions(-) diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 84ade27b4d..97c4a847e3 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -291,9 +291,7 @@ static void add_old_header_file (const char *, int); static void add_this_object_header_file (int); static struct partial_symtab *start_psymtab (struct objfile *, const char *, - CORE_ADDR, int, - std::vector &, - std::vector &); + CORE_ADDR, int); /* Free up old header file tables. */ @@ -1352,9 +1350,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile) { pst = start_psymtab (objfile, namestring, valu, - first_so_symnum * symbol_size, - objfile->global_psymbols, - objfile->static_psymbols); + first_so_symnum * symbol_size); pst->dirname = dirname_nso; dirname_nso = NULL; } @@ -1982,12 +1978,10 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile) static struct partial_symtab * start_psymtab (struct objfile *objfile, const char *filename, CORE_ADDR textlow, - int ldsymoff, std::vector &global_psymbols, - std::vector &static_psymbols) + int ldsymoff) { struct partial_symtab *result = - start_psymtab_common (objfile, filename, textlow, - global_psymbols, static_psymbols); + start_psymtab_common (objfile, filename, textlow); result->read_symtab_private = XOBNEW (&objfile->objfile_obstack, struct symloc); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index be477e3d30..664d0b0e53 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -7851,9 +7851,7 @@ create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name) struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile; struct partial_symtab *pst; - pst = start_psymtab_common (objfile, name, 0, - objfile->global_psymbols, - objfile->static_psymbols); + pst = start_psymtab_common (objfile, name, 0); pst->psymtabs_addrmap_supported = 1; diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 32d6f0b8fd..7b9af6020d 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -2648,9 +2648,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, textlow = 0; pst = start_psymtab_common (objfile, fdr_name (fh), - textlow, - objfile->global_psymbols, - objfile->static_psymbols); + textlow); pst->read_symtab_private = obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc)); memset (pst->read_symtab_private, 0, sizeof (struct symloc)); diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 2d81c16b40..95449e0ada 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -289,9 +289,7 @@ extern void add_psymbol_to_list (const char *, int, extern void init_psymbol_list (struct objfile *, int); extern struct partial_symtab *start_psymtab_common (struct objfile *, - const char *, CORE_ADDR, - std::vector &, - std::vector &); + const char *, CORE_ADDR); extern void end_psymtab_common (struct objfile *, struct partial_symtab *); diff --git a/gdb/psymtab.c b/gdb/psymtab.c index ee593494f6..fe54f1c407 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1530,17 +1530,15 @@ sort_pst_symbols (struct objfile *objfile, struct partial_symtab *pst) struct partial_symtab * start_psymtab_common (struct objfile *objfile, const char *filename, - CORE_ADDR textlow, - std::vector &global_psymbols, - std::vector &static_psymbols) + CORE_ADDR textlow) { struct partial_symtab *psymtab; psymtab = allocate_psymtab (filename, objfile); SET_PSYMTAB_TEXTLOW (psymtab, textlow); SET_PSYMTAB_TEXTHIGH (psymtab, PSYMTAB_RAW_TEXTLOW (psymtab)); /* default */ - psymtab->globals_offset = global_psymbols.size (); - psymtab->statics_offset = static_psymbols.size (); + psymtab->globals_offset = objfile->global_psymbols.size (); + psymtab->statics_offset = objfile->static_psymbols.size (); return psymtab; } diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index a26f4fe88c..788ea89fe4 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2031,16 +2031,13 @@ static unsigned int first_fun_line_offset; static struct partial_symtab * xcoff_start_psymtab (struct objfile *objfile, - const char *filename, int first_symnum, - std::vector &global_psymbols, - std::vector &static_psymbols) + const char *filename, int first_symnum) { struct partial_symtab *result = start_psymtab_common (objfile, filename, /* We fill in textlow later. */ - 0, - global_psymbols, static_psymbols); + 0); result->read_symtab_private = XOBNEW (&objfile->objfile_obstack, struct symloc); @@ -2324,9 +2321,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader, pst = xcoff_start_psymtab (objfile, filestring, - symnum_before, - objfile->global_psymbols, - objfile->static_psymbols); + symnum_before); } } /* Activate the misc_func_recorded mechanism for @@ -2508,9 +2503,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader, pst = xcoff_start_psymtab (objfile, filestring, - symnum_before, - objfile->global_psymbols, - objfile->static_psymbols); + symnum_before); last_csect_name = NULL; } break;