News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Debugging with C structs

Started by draggett, August 21, 2010, 07:23:33 PM

Previous topic - Next topic

draggett

My C programs uses lots of structs that point to other structs. The Code::Blocks debugger UI doesn't make it easy to see what is going on. You have to right click and select add watch, type the name of the variable containing a pointer to a struct, then right click on the watch and select dereference. I don't know how to follow pointers in the dereferenced struct to view a struct it points to.

I guess that there may be some limitations imposed by the debugger (in my case gdb as I am on Ubuntu Linux), but surely the UI could be improved to make dereferencing pointers to structs easier, and to allow you to follow struct pointers to whatever depth you need. One ideas is for Code::Blocks to show the triangle icon before all pointers to structs, so that you can dereference the contents at a single click.

How hard would it be to add this feature to Code::Blocks?

oBFusCATed

There is some work done on this feature in the debuggers branch.
But struct member dereferencing doesn't work too, but adding watches is way easier than the trunk version.
Unfortunately this feature can be implemented only if GDB/mi mode is used,
I've started work on a GDB/mi plugin, but it is not usable for debugging yet.

Some feedback on the changes in the debuggers branch will be wellcome.
You can find the branch in http://svn.berlios.de/wsvn/codeblocks/branches/wxpropgrid_debugger/?rev=6505&peg=6505#ab1bb068457ecc925a5b07fe41a91d401
(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!]