From patchwork Sun Sep 23 15:09:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 29513 Received: (qmail 33616 invoked by alias); 23 Sep 2018 15:10:08 -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 33347 invoked by uid 89); 23 Sep 2018 15:10:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.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.2 spammy=Reading X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.58.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Sep 2018 15:10:04 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 54C78400D229E for ; Sun, 23 Sep 2018 10:10:03 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 461LgCxoIPvAd461Lg5c2d; Sun, 23 Sep 2018 10:10:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vQoyPC3IRfQSRAhJ5l7aXTLfEpj1iHs5EUrzs9hqY+k=; b=UMRYZ7OpAHth9Js+69XuXPDHoY XPcrD5+sARKBVw43c4K44lZdrBV3inCAumzCvoeDDK5tPuNO2fSpHqCtE+4OS9V1/aG/eDLlm6ZAp OmTkObRx11SIzcW9o520yEYno; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:38858 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1g461L-000MFc-3v; Sun, 23 Sep 2018 10:10:03 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 6/7] Only print "no debugging symbols" message once Date: Sun, 23 Sep 2018 09:09:56 -0600 Message-Id: <20180923150957.5798-7-tom@tromey.com> In-Reply-To: <20180923150957.5798-1-tom@tromey.com> References: <20180923150957.5798-1-tom@tromey.com> The "no debugging symbols" message can be confusing in some cases, for example when gdb finds separate debug info for an objfile, but the separate debug info does not contain symbols. For example: (gdb) file /bin/ls Reading symbols from /bin/ls... Reading symbols from .gnu_debugdata for /usr/bin/ls... (No debugging symbols found in .gnu_debugdata for /usr/bin/ls) (No debugging symbols found in /bin/ls) Here, I think the second "no debugging symbols" message is redundant and confusing. This patch changes gdb to only emit this message when the objfile in question does not have a separate debug file. So, in the example above, the output would now read: (gdb) file /bin/ls Reading symbols from /bin/ls... Reading symbols from .gnu_debugdata for /usr/bin/ls... (No debugging symbols found in .gnu_debugdata for /usr/bin/ls) gdb/ChangeLog 2018-09-23 Tom Tromey * symfile.c (symbol_file_add_with_addrs): Do not print "no debugging symbols" message if there is a separate debug objfile. --- gdb/ChangeLog | 5 +++++ gdb/symfile.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gdb/symfile.c b/gdb/symfile.c index ed41b5b70f..981bf336ce 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1128,7 +1128,12 @@ symbol_file_add_with_addrs (bfd *abfd, const char *name, objfile->sf->qf->expand_all_symtabs (objfile); } - if (should_print && !objfile_has_symbols (objfile)) + /* Note that we only print a message if we have no symbols and have + no separate debug file. If there is a separate debug file which + does not have symbols, we'll have emitted this message for that + file, and so printing it twice is just redundant. */ + if (should_print && !objfile_has_symbols (objfile) + && objfile->separate_debug_objfile == nullptr) printf_filtered (_("(No debugging symbols found in %s)\n"), name); if (should_print)