From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id b49qFyf8pGCWOAAAWB0awg (envelope-from ) for ; Wed, 19 May 2021 07:53:11 -0400 Received: by simark.ca (Postfix, from userid 112) id 57D731F11C; Wed, 19 May 2021 07:53:11 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=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 B2EDF1E54D for ; Wed, 19 May 2021 07:53:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C18D386FC37; Wed, 19 May 2021 11:53:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C18D386FC37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621425190; bh=oOwquN5bh/D/omiZqX74koaWBf8UBObN0oAJjrEqUyQ=; h=Date:To:In-Reply-To:Subject:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Ew/3xw96pE/6cRDHMz79gvQ/ardw1ahVnyqry1qezeyqzNSCmDcQPEqB5z7g8rYKB /NOaYyL7vMINqIQxO6v3jZz6mo/XqmK11Zeyy7sV2V2vUMiTr4dKgHzy9hnHx8ZWOX Wwfe2pJ5E4Zgd6R3Tm/gS/8icQdhUop7Iu8tzIdc= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 2B6153857C48 for ; Wed, 19 May 2021 11:53:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2B6153857C48 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45624) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljKl9-0007wo-Pw; Wed, 19 May 2021 07:53:07 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2896 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljKl8-0007cN-6e; Wed, 19 May 2021 07:53:06 -0400 Date: Wed, 19 May 2021 14:53:16 +0300 Message-Id: <838s4bq6s3.fsf@gnu.org> To: Andrew Burgess In-Reply-To: (message from Andrew Burgess on Wed, 19 May 2021 12:12:42 +0100) Subject: Re: [PATCHv2 5/5] gdb: change info sources to group results by objfile References: 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: Eli Zaretskii via Gdb-patches Reply-To: Eli Zaretskii Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" > From: Andrew Burgess > Date: Wed, 19 May 2021 12:12:42 +0100 > > 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 change the format of the 'info sources' results so > that the results are grouped by the object file that uses that source > file. Here's the same session with the new output format: > > (gdb) info sources > /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 objfiles use this source > file. > > All of the existing regular expression based filtering still works. > > An original version of this patch added the new format as an option to > 'info sources', however, it was felt that the new layout was so much > better than the old style that GDB should just switch to the new > result format completely. > > gdb/ChangeLog: > > * NEWS: Mention changes to 'info sources'. > * symtab.c (info_sources_filter::print): Delete. > (struct output_source_filename_data) : Delete > declaration. : New member function. > (output_source_filename_data::print_header): Delete. > (info_sources_worker): Update group-by-objfile style output to > make it CLI suitable, simplify non-group-by-objfile now this is > only used from the MI. > (info_sources_command): Make group-by-objfile be the default for > CLI info sources command. > * symtab.h (struct info_sources_filter) : Delete. > > gdb/doc/ChangeLog: > > * gdb.texinfo (Symbols): Document new output format for 'info > sources'. > > gdb/testsuite/ChangeLog: > > * gdb.base/info_sources_2-header.h: New file. > * gdb.base/info_sources_2-lib.c: New file. > * gdb.base/info_sources_2-test.c: New file. > * gdb.base/info_sources_2.exp: New file. Thanks, the documentation parts are OK.