From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Ql90Aqci2mRnXQAAWB0awg (envelope-from ) for ; Mon, 14 Aug 2023 08:48:39 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=xFIBJP9S; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 007A81E0C2; Mon, 14 Aug 2023 08:48:38 -0400 (EDT) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E664E1E028 for ; Mon, 14 Aug 2023 08:48:36 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79C19385841E for ; Mon, 14 Aug 2023 12:48:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 79C19385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1692017316; bh=BB8AeyUyLqjHkr+tk3QEStNHGVhnNvJ7lXOpg9pnGRI=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=xFIBJP9S/I1miFkQ98M9lnjZqTRLiErvWGCccEwhp10MZQYm03vKW4KCNgKnXiABV yDaMmKqJK4aNQGrZHjbwWFo9EKQmKYj98GWQB0Igfvf0qZ5wDKd65VxeYdNfqFAIDQ fjyRIIWzZqhBm+G2Q5ikXk/orWlGPqRb9U7tO1wI= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 0DAC03858C1F for ; Mon, 14 Aug 2023 12:48:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0DAC03858C1F Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3D2EE2199A; Mon, 14 Aug 2023 12:48:16 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2693C138EE; Mon, 14 Aug 2023 12:48:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id afVcCJAi2mScSQAAMHmgww (envelope-from ); Mon, 14 Aug 2023 12:48:16 +0000 Message-ID: <00ab2507-07dd-3f1c-d21d-3e94fc35159d@suse.de> Date: Mon, 14 Aug 2023 14:48:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb] Fix maint print symbols/psymbols help text Content-Language: en-US To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20230814085340.4066-1-tdevries@suse.de> <83edk5bz3f.fsf@gnu.org> In-Reply-To: <83edk5bz3f.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 8/14/23 14:14, Eli Zaretskii wrote: >> Date: Mon, 14 Aug 2023 10:53:40 +0200 >> From: Tom de Vries via Gdb-patches >> >> diff --git a/gdb/psymtab.c b/gdb/psymtab.c >> index 64b67078641..bdae9db9676 100644 >> --- a/gdb/psymtab.c >> +++ b/gdb/psymtab.c >> @@ -1687,7 +1687,7 @@ Entries in the partial symbol table are dumped to file OUTFILE,\n\ >> or the terminal if OUTFILE is unspecified.\n\ >> If ADDRESS is provided, dump only the file for that address.\n\ >> If SOURCE is provided, dump only that file's symbols.\n\ >> -If OBJFILE is provided, dump only that file's minimal symbols."), >> +If OBJFILE is provided, dump only that object file's symbols."), >> &maintenanceprintlist); >> >> add_cmd ("psymtabs", class_maintenance, maintenance_info_psymtabs, _("\ >> diff --git a/gdb/symmisc.c b/gdb/symmisc.c >> index a65552aa2d2..5b8a82e5137 100644 >> --- a/gdb/symmisc.c >> +++ b/gdb/symmisc.c >> @@ -1052,7 +1052,7 @@ Entries in the full symbol table are dumped to file OUTFILE,\n\ >> or the terminal if OUTFILE is unspecified.\n\ >> If ADDRESS is provided, dump only the file for that address.\n\ >> If SOURCE is provided, dump only that file's symbols.\n\ >> -If OBJFILE is provided, dump only that file's minimal symbols."), >> +If OBJFILE is provided, dump only that object file's symbols."), >> &maintenanceprintlist); >> >> add_cmd ("msymbols", class_maintenance, maintenance_print_msymbols, _("\ > > Thanks, this LGTM, but shouldn't the "ADDRESS" line be reworded like > below? > > If ADDRESS is provided, dump only the symbols for that address. > > If that's not the intent, then can someone please explain the meaning > of "the file for that address"? I played around with it to understand what it does: ... $ gcc -g hello.c $ gdb -q -batch a.out -readnow -ex "maint print symbols" | grep ^Symtab Symtab for file ../sysdeps/x86_64/crtn.S at 0x39c5e60 Symtab for file elf-init.c at 0x39c5260 Symtab for file /usr/lib64/gcc/x86_64-suse-linux/7/include/stddef.h at 0x39c52a0 Symtab for file hello.c at 0x307ff80 Symtab for file /usr/lib64/gcc/x86_64-suse-linux/7/include/stddef.h at 0x307ffc0 Symtab for file /usr/include/bits/types.h at 0x3080000 Symtab for file /usr/include/bits/types/struct_FILE.h at 0x39c2b70 Symtab for file /usr/include/bits/types/FILE.h at 0x39c2bb0 Symtab for file /usr/include/stdio.h at 0x39c2bf0 Symtab for file /usr/include/bits/sys_errlist.h at 0x39c2c30 Symtab for file ../sysdeps/x86_64/crti.S at 0x307fc90 Symtab for file init.c at 0x307f890 Symtab for file ../sysdeps/x86_64/start.S at 0x307f4c0 $ gdb -q -batch a.out -readnow -ex "maint print symbols -pc main" | grep ^Symtab Symtab for file hello.c at 0x242ff80 ... The docs say ( https://sourceware.org/gdb/onlinedocs/gdb/Symbols.html#index-maint-print-symbols ): ... If -pc address is specified, only dump symbols for the file with code at that address. ... So how about: ... If ADDRESS is provided, dump only the symbols for the file with code at that address. ... ? Thanks, - Tom