From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21792 invoked by alias); 28 Mar 2006 23:57:02 -0000 Received: (qmail 21782 invoked by uid 22791); 28 Mar 2006 23:57:01 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 28 Mar 2006 23:56:59 +0000 Received: from kahikatea.snap.net.nz (p202-124-114-183.snap.net.nz [202.124.114.183]) by viper.snap.net.nz (Postfix) with ESMTP id 652F574E751; Wed, 29 Mar 2006 11:56:54 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id AD76D8903; Wed, 29 Mar 2006 11:55:20 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17449.52455.708050.125784@kahikatea.snap.net.nz> Date: Wed, 29 Mar 2006 04:21:00 -0000 To: Bob Rossi Cc: gdb@sources.redhat.com Subject: Re: GDB command "info source" In-Reply-To: <20060328230121.GG9767@brasko.net> References: <17449.45511.144783.549259@kahikatea.snap.net.nz> <20060328230121.GG9767@brasko.net> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00195.txt.bz2 > > In contrast using MI, GDB does yield this information immediately: > > > > nickrob/25 src/gdb/gdb -q -i=mi myprog > > ~"Using host libthread_db library \"/lib/tls/libthread_db.so.1\".\n" > > (gdb) > > -file-list-exec-source-file > > ^done,line="58",file="myprog.c",fullname="/home/nickrob/myprog.c" > > (gdb) > > Yes, that's because of this line > mi-cmd-file.c:72 set_default_source_symtab_and_line(); > > It's a special case for finding the default file. When using annotate 2, > I do 'info line' followed by 'info source'. That doesn't seem to work for me: nickrob/47 src/gdb/gdb -q myprog Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) info line No line number information available. (gdb) info source No current source file. I do "list main" but that doesn't work for languages lik Ada. > > Shouldn't "info source" do the same? > > > > About -file-list-exec-source-file the manual says: > > > > There's no GDB command which directly corresponds to this one. > > > > but apart from this difference, they seem pretty similar. Also > > -file-list-exec-source-files could be likened to "info sources". > > > > WDYT? > > They are similar but not the same. So I don't know. The same could be said for -stack-list-frames and backtrace, -stack-list-locals and "info locals" etc. -- Nick http://www.inet.net.nz/~nickrob