From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway33.websitewelcome.com (gateway33.websitewelcome.com [192.185.146.210]) by sourceware.org (Postfix) with ESMTPS id 5129B3842418 for ; Sun, 28 Feb 2021 20:38:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5129B3842418 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway33.websitewelcome.com (Postfix) with ESMTP id DB693356FB37 for ; Sun, 28 Feb 2021 14:38:08 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id GSpMlo82YqvFOGSpMl2iAN; Sun, 28 Feb 2021 14:38:08 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9gH6mYga4gNNDRxAF5h9/EkUCuEw6FfDv5P53ySQNMc=; b=wN2d27O83M4bp1732if1BihQY3 RF7zHK0V99BXKNwPI+Rt1JQZjutoTnwhjNIqD0av9DJ6g9fOkh6XDB8lgwvqx47Ud9Dv3LAmHxhgy Zd+0vEfgEV+mUeazghjUoepCE; Received: from 97-122-70-152.hlrn.qwest.net ([97.122.70.152]:36730 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lGSpM-000Xf8-KY for gdb-patches@sourceware.org; Sun, 28 Feb 2021 13:38:08 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH 04/26] Change objfile::has_partial_symbols to return bool Date: Sun, 28 Feb 2021 13:37:41 -0700 Message-Id: <20210228203803.1693413-5-tom@tromey.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210228203803.1693413-1-tom@tromey.com> References: <20210228203803.1693413-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.70.152 X-Source-L: No X-Exim-ID: 1lGSpM-000Xf8-KY X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-70-152.hlrn.qwest.net (localhost.localdomain) [97.122.70.152]:36730 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3033.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_BL, RCVD_IN_MSPIKE_L5, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2021 20:38:10 -0000 This changes objfile::has_partial_symbols and quick_symbol_functions::has_symbols to return bool. gdb/ChangeLog 2021-02-28 Tom Tromey * objfiles.h (struct objfile) : Return bool. * symfile.h (struct quick_symbol_functions) : Return bool. * symfile-debug.c (debug_qf_has_symbols): Return bool. * psymtab.c (psym_has_symbols): Return bool. * objfiles.c (objfile::has_partial_symbols): Return bool. * dwarf2/read.c (dw2_has_symbols): Return bool. --- gdb/ChangeLog | 10 ++++++++++ gdb/dwarf2/read.c | 4 ++-- gdb/objfiles.c | 6 +++--- gdb/objfiles.h | 2 +- gdb/psymtab.c | 2 +- gdb/symfile-debug.c | 4 ++-- gdb/symfile.h | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 02176e8da8f..7e55a0ec486 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -5115,10 +5115,10 @@ dw2_map_symbol_filenames (struct objfile *objfile, symbol_filename_ftype *fun, }); } -static int +static bool dw2_has_symbols (struct objfile *objfile) { - return 1; + return true; } const struct quick_symbol_functions dwarf2_gdb_index_functions = diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 53ca66d17e6..746f7d1f296 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -812,11 +812,11 @@ objfile_rebase (struct objfile *objfile, CORE_ADDR slide) /* See objfiles.h. */ -int +bool objfile::has_partial_symbols () { if (!sf) - return 0; + return false; /* If we have not read psymbols, but we have a function capable of reading them, then that is an indication that they are in fact available. Without @@ -824,7 +824,7 @@ objfile::has_partial_symbols () not be present in this objfile. */ if ((flags & OBJF_PSYMTABS_READ) == 0 && sf->sym_read_psymbols != NULL) - return 1; + return true; return sf->qf->has_symbols (this); } diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 0568e16ae4c..f961bdc0116 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -550,7 +550,7 @@ struct objfile /* Return true if OBJFILE has partial symbols. */ - int has_partial_symbols (); + bool has_partial_symbols (); /* The object file's original name as specified by the user, made absolute, and tilde-expanded. However, it is not canonicalized diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 7f41c010e39..94b5acdea54 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1334,7 +1334,7 @@ psym_expand_symtabs_matching /* Psymtab version of has_symbols. See its definition in the definition of quick_symbol_functions in symfile.h. */ -static int +static bool psym_has_symbols (struct objfile *objfile) { return objfile->partial_symtabs->psymtabs != NULL; diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index 2929af81c37..7c022ae341d 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -70,12 +70,12 @@ debug_symtab_name (struct symtab *symtab) /* Debugging version of struct quick_symbol_functions. */ -static int +static bool debug_qf_has_symbols (struct objfile *objfile) { const struct debug_sym_fns_data *debug_data = symfile_debug_objfile_data_key.get (objfile); - int retval; + bool retval; retval = debug_data->real_sf->qf->has_symbols (objfile); diff --git a/gdb/symfile.h b/gdb/symfile.h index 882f17be027..facffeab810 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -150,7 +150,7 @@ struct quick_symbol_functions { /* Return true if this objfile has any "partial" symbols available. */ - int (*has_symbols) (struct objfile *objfile); + bool (*has_symbols) (struct objfile *objfile); /* Return the symbol table for the "last" file appearing in OBJFILE. */ -- 2.26.2