From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 819 invoked by alias); 1 Mar 2003 08:18:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 690 invoked from network); 1 Mar 2003 08:18:57 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by 172.16.49.205 with SMTP; 1 Mar 2003 08:18:57 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 2BD23D34B6; Sat, 1 Mar 2003 00:18:57 -0800 (PST) Date: Sat, 01 Mar 2003 08:18:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: Re: [RFC] Add new command to spit out the linetable for a given file Message-ID: <20030301081857.GD11181@gnat.com> References: <20030301003358.GB11181@gnat.com> <20030301020545.GA32479@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030301020545.GA32479@nevyn.them.org> User-Agent: Mutt/1.4i X-SW-Source: 2003-03/txt/msg00002.txt.bz2 > I believe that this command has been proposed before - I vaguely > remember it even being implemented but I don't know what happened to > the patch. It was "maint info lines" or something similar... > > Would be within the past year in the list archives somewhere but I > can't find it. Thanks Daniel, I think I found the message. I vaguely remembered this too, but couldn't find it in the archives until you reminded me of the proposed syntax. http://sources.redhat.com/ml/gdb-patches/2002-09/msg00084.html This command is associating line numbers from PC addresses, or from a range of addresses. The intent was to be able to generate a mixed source/assembly view of the code. But the patch never got approved because it was felt that this was not the best approach to solve this problem, and because there is already a CLI command that does exactly what the author needed (-data-disassemble). What GVD needs is the opposite: get the PC addresses for each line of a file. We could extend a bit the flexibility of this command by allowing the user to specify a range of line numbers too, to allow a front-end to limit the query to the lines currently visible in the source view, for instance. FernandoN made a very good point that "maint" commands are only intended for debugging or testing GDB. That's why I chose to stay in the "info" commands realm. I first thought about calling this command "info linetable", but dropped this because of completion clashes with the current "info line". So I came up with "info sloc", which I find only so so, but was the best I could find. We are not familiar with the GDB/MI commands yet, but if it is felt that this new functionality would be more suitable if implemented as a MI command, we would be happy to look into that too. Let me know what you think. I believe this new command could be very useful to all GDB frontends. Being able to tell at a glance which lines have code is really a cool and helpful feature. -- Joel