Newbie with a several doubts

Michael Snyder msnyder@vmware.com
Wed Oct 22 18:21:00 GMT 2008


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




More information about the Gdb mailing list