This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Newbie with a several doubts
- From: Michael Snyder <msnyder at vmware dot com>
- To: quinty <webquinty2 at gmail dot com>
- Cc: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Wed, 22 Oct 2008 11:15:45 -0700
- Subject: Re: Newbie with a several doubts
- References: <2f7417810810220220i714dcfbdo2b6824145c36e9b6@mail.gmail.com> <2f7417810810220229v3477c2eescfbef4f59fb89d67@mail.gmail.com>
quinty wrote:
Hello,
Let me introduce myself, I am John from Spain, and I am developing a
new application in Linux.
In this moment I have a important doubt, is it possible to watch a var
without stop program???.
Is it possible to insert code in my application to use it with gdb and
debug my programm??
I am not sure if my questions are silly or not.
Hello John,
I'm not sure if I understand your question(s).
Regarding the first question, there is an "async mode"
in which gdb can do limited debuging on a program that is
not stopped. I don't know enough about async mode, perhaps
someone who knows it better than I can answer.
In the normal debugging mode, gdb cannot look at the
value of a variable without stopping the program.
However, it can be a brief stop -- eg. set a breakpoint,
and when the breakpoint is hit, print the value and
then immediately continue again.
Regarding your second question -- you can write a function
into your program and then let gdb call the function.
But the program has to be stopped in order for gdb to
do that.
Hope this helps...
Michael