From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MPMODykbRmIfHgAAWB0awg (envelope-from ) for ; Thu, 31 Mar 2022 17:20:41 -0400 Received: by simark.ca (Postfix, from userid 112) id 3ABCD1F163; Thu, 31 Mar 2022 17:20:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BB44C1E150 for ; Thu, 31 Mar 2022 17:20:40 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 256D53898C77 for ; Thu, 31 Mar 2022 21:20:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 256D53898C77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1648761640; bh=rFj0rwkyLbTIqOwZhAy6VHqZYP8yNSmvjd2pCRNcmxw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xxofmDicWMBrmWk7soYUr5xJpolbQ6uhWqUUHntjlmfEnIyIDhG6rleJAPGXVpoTs upCcdOWwr3sj0bJOr7CBivJJ/TpD25FfN3JvMAz0pdJZT/Vv8brzj9eiMvwzky9qXW R7bI/BbiBo+0l6vK5PLDG91tY1lry7z/PsSMjOy0= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 5B4F538515F7 for ; Thu, 31 Mar 2022 21:20:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5B4F538515F7 X-ASG-Debug-ID: 1648761620-0c856e06aba4ac50001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id qa3MwtB2T7Zxi5T4 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 31 Mar 2022 17:20:20 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id 5388C441D64; Thu, 31 Mar 2022 17:20:20 -0400 (EDT) X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Subject: [PATCH 2/3] gdb: print compunit_symtab name in "maint info symtabs" Date: Thu, 31 Mar 2022 17:20:18 -0400 X-ASG-Orig-Subj: [PATCH 2/3] gdb: print compunit_symtab name in "maint info symtabs" Message-Id: <20220331212019.2811099-2-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220331212019.2811099-1-simon.marchi@polymtl.ca> References: <20220331212019.2811099-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1648761620 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2810 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.97040 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" I think it would make sense to print a compunit_symtab's name in "maint info symtabs". If you are looking for a given CU in the list, that's probably the field you will be looking at. As the doc of compunit_symtab::name says, it is not meant to be a reliable file name, it is for debugging purposes (and "maint info symtabs" exists for debugging purposes). Sample output with the new field: (gdb) maintenance info symtabs { objfile /home/simark/build/binutils-gdb-one-target/gdb/a.out ((struct objfile *) 0x613000005d00) { ((struct compunit_symtab *) 0x621000131630) debugformat DWARF 5 producer GNU C17 11.2.0 -mtune=generic -march=x86-64 -g3 -O0 name test.c dirname /home/simark/build/binutils-gdb-one-target/gdb blockvector ((struct blockvector *) 0x621000131d10) user ((struct compunit_symtab *) (null)) { symtab test.c ((struct symtab *) 0x6210001316b0) fullname (null) linetable ((struct linetable *) 0x621000131d40) } { symtab /home/simark/build/binutils-gdb-one-target/gdb/test.h ((struct symtab *) 0x6210001316e0) fullname (null) linetable ((struct linetable *) 0x0) } { symtab /usr/include/stdc-predef.h ((struct symtab *) 0x621000131710) fullname (null) linetable ((struct linetable *) 0x0) } } { ((struct compunit_symtab *) 0x6210001170a0) debugformat DWARF 5 producer GNU C17 11.2.0 -mtune=generic -march=x86-64 -g3 -O0 name foo.c dirname /home/simark/build/binutils-gdb-one-target/gdb blockvector ((struct blockvector *) 0x621000131580) user ((struct compunit_symtab *) (null)) { symtab foo.c ((struct symtab *) 0x621000117120) fullname (null) linetable ((struct linetable *) 0x6210001315b0) } { symtab /usr/include/stdc-predef.h ((struct symtab *) 0x621000117150) fullname (null) linetable ((struct linetable *) 0x0) } } } Change-Id: I17b87adfac2f6551cb5bda30d59f6c6882789211 --- gdb/symmisc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 37ecc8064da5..d33ea0fed9a4 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -781,6 +781,7 @@ maintenance_info_symtabs (const char *regexp, int from_tty) gdb_printf (" producer %s\n", (cust->producer () != nullptr ? cust->producer () : "(null)")); + gdb_printf (" name %s\n", cust->name); gdb_printf (" dirname %s\n", (cust->dirname () != NULL ? cust->dirname () : "(null)")); -- 2.35.1