From patchwork Sun Nov 24 18:13:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 36164 Received: (qmail 128705 invoked by alias); 24 Nov 2019 18:13:42 -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 128696 invoked by uid 89); 24 Nov 2019 18:13:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=sk:find_pc, Initialize, sk:psymtab, lbasename X-HELO: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.47.100) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 24 Nov 2019 18:13:39 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway22.websitewelcome.com (Postfix) with ESMTP id D91A1A04B for ; Sun, 24 Nov 2019 12:13:37 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id YwO9ism3D3Qi0YwO9iA7E2; Sun, 24 Nov 2019 12:13:37 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=aSA4ZBHIKv+zSu0Hrz2KH601wXKy9eUcHuHAYSauZ7E=; b=n8pj/P1ogz3xOe5chc3BWusaMg cZBFjeL66i8XWP1iLLMYSC0TVwrUtLuUBTOQ/BKdTc1oO/GB9tQ8Vh4J++6nI+IIu7m0loQjaaXvx QC7qK2CGMsD7R95vKYF92Nye0; Received: from 97-118-104-188.hlrn.qwest.net ([97.118.104.188]:45524 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iYwO9-0013ef-NA; Sun, 24 Nov 2019 11:13:37 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Use bool in require_partial_symbols Date: Sun, 24 Nov 2019 11:13:36 -0700 Message-Id: <20191124181336.9160-1-tom@tromey.com> This changes require_partial_symbols to use bool as its parameter type. gdb/ChangeLog 2019-11-24 Tom Tromey * symfile.c (read_symbols): Update. * psymtab.c (require_partial_symbols): Change type of "verbose" to bool. (psym_map_symtabs_matching_filename, find_pc_sect_psymtab) (psym_lookup_symbol, psym_find_last_source_symtab) (psym_forget_cached_source_info, psym_print_stats) (psym_expand_symtabs_for_function, psym_expand_all_symtabs) (psym_expand_symtabs_with_fullname, psym_map_symbol_filenames) (psym_map_matching_symbols, psym_expand_symtabs_matching) (psym_find_compunit_symtab_by_address) (maintenance_print_psymbols, maintenance_info_psymtabs) (maintenance_check_psymtabs): Update. * psymtab.h (require_partial_symbols): Change type of "verbose" to bool. Change-Id: Iae87aa5e4590706bb9e90a33adb86f1fe0fbf3c7 --- gdb/ChangeLog | 17 +++++++++++++++++ gdb/psymtab.c | 34 +++++++++++++++++----------------- gdb/psymtab.h | 4 ++-- gdb/symfile.c | 2 +- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/gdb/psymtab.c b/gdb/psymtab.c index c3155007bbd..7074a32956a 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -94,7 +94,7 @@ psymtab_storage::allocate_psymtab () /* See psymtab.h. */ psymtab_storage::partial_symtab_range -require_partial_symbols (struct objfile *objfile, int verbose) +require_partial_symbols (struct objfile *objfile, bool verbose) { if ((objfile->flags & OBJF_PSYMTABS_READ) == 0) { @@ -161,7 +161,7 @@ psym_map_symtabs_matching_filename { const char *name_basename = lbasename (name); - for (partial_symtab *pst : require_partial_symbols (objfile, 1)) + for (partial_symtab *pst : require_partial_symbols (objfile, true)) { /* We can skip shared psymtabs here, because any file name will be attached to the unshared psymtab. */ @@ -364,7 +364,7 @@ find_pc_sect_psymtab (struct objfile *objfile, CORE_ADDR pc, its CUs may be missing in PSYMTABS_ADDRMAP as they may be varying debug info type in single OBJFILE. */ - for (partial_symtab *pst : require_partial_symbols (objfile, 1)) + for (partial_symtab *pst : require_partial_symbols (objfile, true)) if (!pst->psymtabs_addrmap_supported && pc >= pst->text_low (objfile) && pc < pst->text_high (objfile)) { @@ -490,7 +490,7 @@ psym_lookup_symbol (struct objfile *objfile, lookup_name_info lookup_name (name, symbol_name_match_type::FULL); - for (partial_symtab *ps : require_partial_symbols (objfile, 1)) + for (partial_symtab *ps : require_partial_symbols (objfile, true)) { if (!ps->readin && lookup_partial_symbol (objfile, ps, name, psymtab_index, domain)) @@ -780,7 +780,7 @@ psym_find_last_source_symtab (struct objfile *ofp) { struct partial_symtab *cs_pst = NULL; - for (partial_symtab *ps : require_partial_symbols (ofp, 1)) + for (partial_symtab *ps : require_partial_symbols (ofp, true)) { const char *name = ps->filename; int len = strlen (name); @@ -816,7 +816,7 @@ psym_find_last_source_symtab (struct objfile *ofp) static void psym_forget_cached_source_info (struct objfile *objfile) { - for (partial_symtab *pst : require_partial_symbols (objfile, 1)) + for (partial_symtab *pst : require_partial_symbols (objfile, true)) { if (pst->fullname != NULL) { @@ -1007,7 +1007,7 @@ psym_print_stats (struct objfile *objfile) int i; i = 0; - for (partial_symtab *ps : require_partial_symbols (objfile, 1)) + for (partial_symtab *ps : require_partial_symbols (objfile, true)) { if (ps->readin == 0) i++; @@ -1047,7 +1047,7 @@ static void psym_expand_symtabs_for_function (struct objfile *objfile, const char *func_name) { - for (partial_symtab *ps : require_partial_symbols (objfile, 1)) + for (partial_symtab *ps : require_partial_symbols (objfile, true)) { if (ps->readin) continue; @@ -1066,7 +1066,7 @@ psym_expand_symtabs_for_function (struct objfile *objfile, static void psym_expand_all_symtabs (struct objfile *objfile) { - for (partial_symtab *psymtab : require_partial_symbols (objfile, 1)) + for (partial_symtab *psymtab : require_partial_symbols (objfile, true)) psymtab_to_symtab (objfile, psymtab); } @@ -1077,7 +1077,7 @@ static void psym_expand_symtabs_with_fullname (struct objfile *objfile, const char *fullname) { - for (partial_symtab *p : require_partial_symbols (objfile, 1)) + for (partial_symtab *p : require_partial_symbols (objfile, true)) { /* Anonymous psymtabs don't have a name of a source file. */ if (p->anonymous) @@ -1100,7 +1100,7 @@ psym_map_symbol_filenames (struct objfile *objfile, symbol_filename_ftype *fun, void *data, int need_fullname) { - for (partial_symtab *ps : require_partial_symbols (objfile, 1)) + for (partial_symtab *ps : require_partial_symbols (objfile, true)) { const char *fullname; @@ -1181,7 +1181,7 @@ psym_map_matching_symbols { const int block_kind = global ? GLOBAL_BLOCK : STATIC_BLOCK; - for (partial_symtab *ps : require_partial_symbols (objfile, 1)) + for (partial_symtab *ps : require_partial_symbols (objfile, true)) { QUIT; if (ps->readin @@ -1312,7 +1312,7 @@ psym_expand_symtabs_matching lookup_name_info lookup_name = lookup_name_in.make_ignore_params (); /* Clear the search flags. */ - for (partial_symtab *ps : require_partial_symbols (objfile, 1)) + for (partial_symtab *ps : require_partial_symbols (objfile, true)) ps->searched_flag = PST_NOT_SEARCHED; for (partial_symtab *ps : objfile->psymtabs ()) @@ -1406,7 +1406,7 @@ psym_find_compunit_symtab_by_address (struct objfile *objfile, { std::set seen_addrs; - for (partial_symtab *pst : require_partial_symbols (objfile, 1)) + for (partial_symtab *pst : require_partial_symbols (objfile, true)) { psym_fill_psymbol_map (objfile, pst, &seen_addrs, @@ -1901,7 +1901,7 @@ maintenance_print_psymbols (const char *args, int from_tty) } else { - for (partial_symtab *ps : require_partial_symbols (objfile, 1)) + for (partial_symtab *ps : require_partial_symbols (objfile, true)) { int print_for_source = 0; @@ -1966,7 +1966,7 @@ maintenance_info_psymtabs (const char *regexp, int from_tty) actually find a symtab whose name matches. */ int printed_objfile_start = 0; - for (partial_symtab *psymtab : require_partial_symbols (objfile, 1)) + for (partial_symtab *psymtab : require_partial_symbols (objfile, true)) { QUIT; @@ -2072,7 +2072,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty) int length; for (objfile *objfile : current_program_space->objfiles ()) - for (partial_symtab *ps : require_partial_symbols (objfile, 1)) + for (partial_symtab *ps : require_partial_symbols (objfile, true)) { struct gdbarch *gdbarch = get_objfile_arch (objfile); diff --git a/gdb/psymtab.h b/gdb/psymtab.h index 0ad2b49d9a5..a4ac35a7916 100644 --- a/gdb/psymtab.h +++ b/gdb/psymtab.h @@ -147,11 +147,11 @@ extern const struct quick_symbol_functions dwarf2_gdb_index_functions; extern const struct quick_symbol_functions dwarf2_debug_names_functions; /* Ensure that the partial symbols for OBJFILE have been loaded. If - VERBOSE is non-zero, then this will print a message when symbols + VERBOSE is true, then this will print a message when symbols are loaded. This function returns a range adapter suitable for iterating over the psymtabs of OBJFILE. */ extern psymtab_storage::partial_symtab_range require_partial_symbols - (struct objfile *objfile, int verbose); + (struct objfile *objfile, bool verbose); #endif /* PSYMTAB_H */ diff --git a/gdb/symfile.c b/gdb/symfile.c index e6b34bc6b79..aec07d7a7ab 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -809,7 +809,7 @@ read_symbols (struct objfile *objfile, symfile_add_flags add_flags) } } if ((add_flags & SYMFILE_NO_READ) == 0) - require_partial_symbols (objfile, 0); + require_partial_symbols (objfile, false); } /* Initialize entry point information for this objfile. */