Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] graphical visualization for C global variables

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Abdelhalim Ragab
> Sent: Friday, May 06, 2011 2:54 PM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] graphical visualization for C global variables
> 
> Hi,
> 
> I'm interested in creating some runtime visual chart for the global
> variables in some application I'm running. I guess there is a lot of
> packages that will allow me to draw the charts, but I'm wondering how
> can I hook it to a C debugger. One way I was using previously is
> setting breakpoints on some function, and get the value on the
> variable when the breakpoint is hit, then continue automatically, but
> I don't like this solution as it require a breakpoint in a location
> that I know will be executed frequently, which is not obvious always,
> and cannot be automated.
> 
> Any other way to get global variables' values periodically?

The only solution I can think of for Eclipse is Watchpoints, but
I think it is affect your performance much too much.
For completeness, let me tell you my thought.  You can use Watchpoints and 
automatically resume them after printing.  Because the watchpoints
would hit every time a variable changes, you will probably need a condition
to only print the value if enough time has passed.
This is very much like you do for breakpoints, but then you wouldn't need to 
find a location that you know will be hit often.  But I believe this will affect the
performance of your execution _a lot_.
My impression is that it is not such a good idea.

Maybe you can do something in GDB directly.  Using python scripting in GDB, you
could periodically interrupt the program, read the variables and resume.
I'm not sure if the GDB python support provides such periodic operations,
but it may.

Good luck

Marc



Back to the top