Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: ScotlandTheScared on April 14, 2011, 11:04:34 am
-
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.
-
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.
-
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.
-
look at this as a reference.
http://code.google.com/p/qp-gcc/wiki/GDB
-
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.
-
You can try DDD (http://www.gnu.org/software/ddd/) on Ubuntu.