From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5309 invoked by alias); 28 Mar 2006 22:01:23 -0000 Received: (qmail 5299 invoked by uid 22791); 28 Mar 2006 22:01:21 -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 22:01:16 +0000 Received: from kahikatea.snap.net.nz (p202-124-115-179.snap.net.nz [202.124.115.179]) by viper.snap.net.nz (Postfix) with ESMTP id 9575774EA39 for ; Wed, 29 Mar 2006 10:01:09 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id D9CB48903; Wed, 29 Mar 2006 09:59:35 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17449.45511.144783.549259@kahikatea.snap.net.nz> Date: Tue, 28 Mar 2006 22:21:00 -0000 To: gdb@sources.redhat.com Subject: GDB command "info source" 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/msg00190.txt.bz2 Starting GNU gdb 6.4.50.20060325-cvs, I get the following: nickrob/24 src/gdb/gdb -q myprog Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) help info source Information about the current source file. (gdb) info source No current source file. (gdb) b 10 Breakpoint 1 at 0x8048498: file myprog.c, line 10. So GDB seems to assume myprog.c is current, but doesn't share that information with the user until now... (gdb) info source Current source file is myprog.c Compilation directory is /home/nickrob Source language is c. Compiled with DWARF 2 debugging format. Includes preprocessor macro info. 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) 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? -- Nick http://www.inet.net.nz/~nickrob