From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 8AAFE385B834 for ; Tue, 24 Mar 2020 09:01:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8AAFE385B834 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9BF7EAFF6 for ; Tue, 24 Mar 2020 09:01:40 +0000 (UTC) Date: Tue, 24 Mar 2020 10:01:39 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb] Print user for maint info psymtabs Message-ID: <20200324090137.GA20763@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-37.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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: Tue, 24 Mar 2020 09:01:42 -0000 Hi, The type struct partial_symtab contains two fields (disregarding field next) that express relations with other symtabs: user and dependencies. When using "maint print psymbols", we see both the dependencies and the user fields: ... Partial symtab for source file (object 0x35ef270) ... Depends on 0 other partial symtabs. Shared partial symtab with user 0x35d5f40 ... But with "maint info psymtabs", we only see dependencies: ... { psymtab ((struct partial_symtab *) 0x35ef270) ... dependencies (none) } ... Add printing of the user field for "maint info psymtabs", such that we have: ... { psymtab ((struct partial_symtab *) 0x35ef270) ... + user hello.c ((struct partial_symtab *) 0x35d5f40) dependencies (none) } ... Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb] Print user for maint info psymtabs gdb/ChangeLog: 2020-03-24 Tom de Vries * psymtab.c (maintenance_info_psymtabs): Print user field. --- gdb/psymtab.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/psymtab.c b/gdb/psymtab.c index f77f6d5108..8aa9c6e87b 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -2065,6 +2065,11 @@ maintenance_info_psymtabs (const char *regexp, int from_tty) } else printf_filtered ("(none)\n"); + if (psymtab->user) + printf_filtered (" user %s " + "((struct partial_symtab *) %s)\n", + psymtab->user->filename, + host_address_to_string (psymtab->user)); printf_filtered (" dependencies "); if (psymtab->number_of_dependencies) {