From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 9nqiClNAnWC0fAAAWB0awg (envelope-from ) for ; Thu, 13 May 2021 11:05:55 -0400 Received: by simark.ca (Postfix, from userid 112) id 1DFB41F11C; Thu, 13 May 2021 11:05:55 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 5CF921E783 for ; Thu, 13 May 2021 11:05:54 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DD30E385700D; Thu, 13 May 2021 15:05:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD30E385700D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620918353; bh=F1/Deo7Jc7FFm+lAxtk0zDFOp8OFE6XAqFraGmr4W3g=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=fGtbT12JuNLCaylsQkYJTD3ETqh4RgN+vjGEVFjLYH/zDejPWtBzhLvCMchDRbNJM zo9vcrBnIhWh2hx+0fUIhTjDpsOi3UgtYCe9qUxCaVcz4jef28fVoY1rRXi2gEZH9X eP7QyM3p+NuzY+QVZGvqXmb6XQ4upg2349R+4ifM= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id CF6E2385700D for ; Thu, 13 May 2021 15:05:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CF6E2385700D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 14DF5iDn008006 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 May 2021 11:05:49 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 14DF5iDn008006 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A7A301E783; Thu, 13 May 2021 11:05:44 -0400 (EDT) Subject: Re: [PATCH 3/4] gdb: add new -group-by-binary flag to info sources command To: Andrew Burgess , gdb-patches@sourceware.org References: <760d52a0ea6ab8c2195d71feea794f0bec70a163.1619456691.git.andrew.burgess@embecosm.com> Message-ID: <5f7a72f3-a352-c107-4d10-3fadb7ecee38@polymtl.ca> Date: Thu, 13 May 2021 11:05:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <760d52a0ea6ab8c2195d71feea794f0bec70a163.1619456691.git.andrew.burgess@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 13 May 2021 15:05:44 +0000 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@sourceware.org Sender: "Gdb-patches" On 2021-04-26 1:07 p.m., Andrew Burgess wrote: > Currently the 'info sources' command lists all of the known source > files together, regardless of their source, e.g. here is a session > debugging a test application that makes use of a shared library: > > (gdb) info sources > Source files for which symbols have been read in: > > /tmp/info-sources/test.c, /usr/include/stdc-predef.h, > /tmp/info-sources/header.h, /tmp/info-sources/helper.c > > Source files for which symbols will be read in on demand: > > (gdb) > > In this commit I add a new flag to the 'info sources' command, > '-group-by-binary'. When this flag is provided the results are > grouped by the binary file that uses that source file. Here's the > same session using the new flag: > > (gdb) info sources -group-by-binary > /tmp/info-sources/test.x: > > /tmp/info-sources/test.c, /usr/include/stdc-predef.h, > /tmp/info-sources/header.h > > /lib64/ld-linux-x86-64.so.2: > (Full debug information has not yet been read for this file.) > > system-supplied DSO at 0x7ffff7fcf000: > (Full debug information has not yet been read for this file.) > > /tmp/info-sources/libhelper.so: > > /tmp/info-sources/helper.c, /usr/include/stdc-predef.h, > /tmp/info-sources/header.h > > /lib64/libc.so.6: > (Full debug information has not yet been read for this file.) > > (gdb) > > Notice that in the new output some source files are repeated, > e.g. /tmp/info-sources/header.h, as multiple binaries use this source > file. > > All of the existing regular expression based filtering that exists for > 'info sources' still works with the new option. In my opinion the new output is just better, more structured. Do we even need to hide it behind an option? Can we just... change it and that's it? I'd lke if we didn't have to keep the extra complexity unnecessarily. Simon