From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25668 invoked by alias); 13 Apr 2018 13:09:45 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 25657 invoked by uid 89); 13 Apr 2018 13:09:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org 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,SPF_PASS autolearn=ham version=3.3.2 spammy=(unknown) X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Apr 2018 13:09:43 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id B5140300060A; Fri, 13 Apr 2018 15:09:40 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 715AB413CEBB; Fri, 13 Apr 2018 15:09:40 +0200 (CEST) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [COMMITTED] readelf: Only lookup files and show errors in attr_callback when not silent. Date: Fri, 13 Apr 2018 13:09:00 -0000 Message-Id: <1523624979-20664-1-git-send-email-mark@klomp.org> X-Mailer: git-send-email 1.8.3.1 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2018-q2/txt/msg00010.txt.bz2 We recently added a couple more sanity checks and show an error when attributes that represent files cannot be resolved. We should only do this when the attr_callback should print the attribute information. When not (for example when not showing the .debug_info section, but only collecting information about the CUs containing pointers into other sections) we don't need to lookup the file names, nor print the errors/warnings. Signed-off-by: Mark Wielaard --- src/ChangeLog | 4 ++++ src/readelf.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 55eb279..068c87b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2018-04-14 Mark Wielaard + + * readelf.c (attr_callback): Only show errors when not silent. + 2018-03-23 Mark Wielaard * readelf.c (attr_callback): Handle DW_FORM_strx[1234]. diff --git a/src/readelf.c b/src/readelf.c index 3fb5ee6..8c0ef6c 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -6253,6 +6253,9 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) case DW_AT_decl_file: case DW_AT_call_file: { + if (cbargs->silent) + break; + /* Try to get the actual file, the current interface only gives us full paths, but we only want to show the file name for now. */ -- 1.8.3.1