From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3098 invoked by alias); 25 May 2005 15:10:34 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 3087 invoked by uid 22791); 25 May 2005 15:10:29 -0000 Received: from lakermmtao06.cox.net (HELO lakermmtao06.cox.net) (68.230.240.33) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 25 May 2005 15:10:29 +0000 Received: from white ([68.9.64.121]) by lakermmtao06.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050525151027.BFOY749.lakermmtao06.cox.net@white>; Wed, 25 May 2005 11:10:27 -0400 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1DaxWd-0004tN-00; Wed, 25 May 2005 11:10:27 -0400 Date: Wed, 25 May 2005 15:10:00 -0000 From: Bob Rossi To: Ismail Donmez Cc: gdb@sources.redhat.com Subject: Re: Is this possible with gdb? Message-ID: <20050525151027.GE18451@white> Mail-Followup-To: Ismail Donmez , gdb@sources.redhat.com References: <200505251805.59367.ismail@kde.org.tr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200505251805.59367.ismail@kde.org.tr> User-Agent: Mutt/1.3.28i X-SW-Source: 2005-05/txt/msg00318.txt.bz2 On Wed, May 25, 2005 at 06:05:59PM +0300, Ismail Donmez wrote: > Hi all, > > Sorry if this question came up early before but a Google search didn't result > in much answer. What I want to do is to see currently executed line to be > printed on console while using gdb. > > Say I got this in foo.cpp > > int main() > { > i=2; > return 0; > } > > compiled into foo and I want gdb to print > > foo.cpp: line 3 > foo.cpp line 4 > > > So I just want to see porgram flow. Is this possible with gdb or can anyone > suggest any other solution? > > Any help is grealy appreciated. GDB is not a code coverage tool. You could look into use gcov. However, with GDB you can step through your program. Try this, gdb ./foo b main r n n n n If you like what you see, try reading the manual. Bob Rossi