From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19743 invoked by alias); 29 Mar 2006 01:23:40 -0000 Received: (qmail 19717 invoked by uid 22791); 29 Mar 2006 01:23:40 -0000 X-Spam-Check-By: sourceware.org Received: from eastrmmtao04.cox.net (HELO eastrmmtao04.cox.net) (68.230.240.35) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 29 Mar 2006 01:23:39 +0000 Received: from localhost.localdomain ([68.9.66.48]) by eastrmmtao04.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060329012335.IVAW19943.eastrmmtao04.cox.net@localhost.localdomain>; Tue, 28 Mar 2006 20:23:35 -0500 Received: from bob by localhost.localdomain with local (Exim 4.52) id 1FOPPP-0005MO-8u; Tue, 28 Mar 2006 20:23:39 -0500 Date: Wed, 29 Mar 2006 04:35:00 -0000 From: Bob Rossi To: Nick Roberts Cc: gdb@sources.redhat.com Subject: Re: GDB command "info source" Message-ID: <20060329012339.GI9767@brasko.net> Mail-Followup-To: Nick Roberts , gdb@sources.redhat.com References: <17449.45511.144783.549259@kahikatea.snap.net.nz> <20060328230121.GG9767@brasko.net> <17449.52455.708050.125784@kahikatea.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17449.52455.708050.125784@kahikatea.snap.net.nz> User-Agent: Mutt/1.5.9i 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/msg00196.txt.bz2 On Wed, Mar 29, 2006 at 11:55:19AM +1200, Nick Roberts wrote: > > > 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. Oops, I'm very sorry. I simply do 'list'. That works for C/C++ and kind of works for ADA. By that I mean, it takes you to the 'main' function instead of the function that ADA starts off at. You should look at what GVD does, since it figures out what the starting ADA function is and it uses annotate=1. > > > 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. OK, if that's the case, then yes, I agree with you. Bob Rossi