News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Plotting variables during debug?

Started by ScotlandTheScared, April 14, 2011, 11:04:34 AM

Previous topic - Next topic

ScotlandTheScared

Hi - I am new to code::blocks. I am wondering if there is any way to plot a graph of a 1-dimensional array (i.e. list) variable when I stop at breakpoints during debug?

Any help would be much appreciated.

oBFusCATed

I don't think there is a way to do it inside codeblocks.
Newer gdbs have python scripting support, so probably you can do it inside a python pretty printer or you could define a plot command in python.

I think, you could write the values to a file and then use gnuplot to generate the image.

Then in c::b you can send this command "python my_plot myvar" to gdb.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ScotlandTheScared

Thanks - shame there seems to be no easy way of doing this. I dont want to have to write out any data to files - that is extremely clunky. And I have no idea how to run a python script from within the debugger anyway. I really am not a good programmer. I am trying to debug someone else's program - I have previously simply managed to find errors without using a debugger, but its proving difficult this time, hence the need for a debugger that can allow me to view a plot of an array.

Anyone else got anything that might help? I'm running on ubuntu 10.10.

ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

ScotlandTheScared

Thanks - but being a novice programmer this is getting beyond me. I had just hoped that code::blocks might provide something build-in already so that I can view a 1D array/list. I'm generating these in fortran and I can print the variables to the screen. But the size of the arrays (length=1000) mean a graph would be far more useful.

The inclusion of something like this would open up code::blocks as a debugger for a lot of people I know where array processing is the bread and butter of their work.

m.29

Windows XP SP3, wxWidgets 2.8.11, C::B DEBUGGER BRANCH nightly builds