From patchwork Thu Apr 5 11:59:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 26613 Received: (qmail 8097 invoked by alias); 5 Apr 2018 11:59:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 8087 invoked by uid 89); 5 Apr 2018 11:59:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Apr 2018 11:59:21 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w35BsX2w020135 for ; Thu, 5 Apr 2018 07:59:20 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h5hv9c0nu-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 05 Apr 2018 07:59:20 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Apr 2018 12:59:18 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 5 Apr 2018 12:59:16 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w35BxG7h49741860; Thu, 5 Apr 2018 11:59:16 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AB0464203F; Thu, 5 Apr 2018 12:51:05 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8BC7142042; Thu, 5 Apr 2018 12:51:05 +0100 (BST) Received: from oc1027705133.ibm.com (unknown [9.152.212.201]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 5 Apr 2018 12:51:05 +0100 (BST) From: Andreas Arnez To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Show line numbers in output for "info var/func/type" References: <83r2nu3hdl.fsf@gnu.org> Date: Thu, 05 Apr 2018 13:59:13 +0200 In-Reply-To: <83r2nu3hdl.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 04 Apr 2018 22:23:50 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18040511-0040-0000-0000-0000042AC404 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040511-0041-0000-0000-0000262DFA75 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-04-05_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804050127 X-IsSubscribed: yes On Wed, Apr 04 2018, Eli Zaretskii wrote: >> From: Andreas Arnez >> Date: Wed, 04 Apr 2018 20:53:00 +0200 >> >> gdb/ChangeLog: >> >> * symtab.c (print_symbol_info): Precede the symbol definition by >> the line number when available. >> * NEWS: Advertise this enhancement. > > Thanks, but I think the manual should also be updated. OK. How about the patch below? > The NEWS part of the patch is OK. Thanks! --- Andreas diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index bd20b39c63..0ea11898e5 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -17522,7 +17522,7 @@ name is @code{value}. This command differs from @code{ptype} in two ways: first, like @code{whatis}, it does not print a detailed description; second, it -lists all source files where a type is defined. +lists all source files and line numbers where a type is defined. @kindex info type-printers @item info type-printers @@ -17600,24 +17600,29 @@ have already been read, and files whose symbols will be read when needed. @kindex info functions @item info functions Print the names and data types of all defined functions. +Similarly to @samp{info types}, this command groups its output by source +files and annotates each function definition with its source line +number. @item info functions @var{regexp} -Print the names and data types of all defined functions -whose names contain a match for regular expression @var{regexp}. -Thus, @samp{info fun step} finds all functions whose names -include @code{step}; @samp{info fun ^step} finds those whose names -start with @code{step}. If a function name contains characters -that conflict with the regular expression language (e.g.@: +Like @samp{info functions}, but only print the names and data types of +functions whose names contain a match for regular expression +@var{regexp}. Thus, @samp{info fun step} finds all functions whose +names include @code{step}; @samp{info fun ^step} finds those whose names +start with @code{step}. If a function name contains characters that +conflict with the regular expression language (e.g.@: @samp{operator*()}), they may be quoted with a backslash. @kindex info variables @item info variables Print the names and data types of all variables that are defined outside of functions (i.e.@: excluding local variables). +The printed variables are grouped by source files and annotated with +their respective source line numbers. @item info variables @var{regexp} -Print the names and data types of all variables (except for local -variables) whose names contain a match for regular expression +Like @kbd{info variables}, but only print the names and data types of +non-local variables whose names contain a match for regular expression @var{regexp}. @kindex info classes