This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Is this possible with gdb?
- From: Bob Rossi <bob at brasko dot net>
- To: Ismail Donmez <ismail at kde dot org dot tr>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 25 May 2005 11:10:27 -0400
- Subject: Re: Is this possible with gdb?
- References: <200505251805.59367.ismail@kde.org.tr>
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
> <exit>
>
> 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