Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: babis on January 19, 2016, 12:13:12 am
-
Hi,
I'm using code::blocks 13.12 in Linux Mint.
I have both gdb 7.10.1 and 7.7.1, and I've downloaded the python code for pretty printing -- both exhibit the below problem.
Sometimes, when I'm trying to print a shared_ptr ( using either "print (*ptr.get())" or "print *ptr" or "print *ptr._M_ptr") I get no output; it just halts there and I have to kill gdb, sometimes code::blocks too. I've tried the same thing in Eclipse, but I didn't get such a problem. The structure that I'm trying to print (or equivalently, display in the watch window) is complex; several STL vectors and sets and maps and so on.
I created a test application with a shared_ptr of a very simple structure, and it works as expected.
If I print a variable within the structure, it also works ok.
I'm suspecting a "maximum size" of sorts, that I'm exceeding.
Anybody have any ideas?
Thanks.
-
If the vectors are containing lots of data then probably this is causing the problem.
At the moment nothing could be done as far as I know.
-
Thanks! Quick and spot on :)
I'm pretty sure I've seen a post somewhere to add some line in the python code to clamp the displayed number of elements, but I've lost it now dammit...
-
Ok, for reference, it's fixed by just setting a limit to how many elements shall be printed, for example using the below:
set print elements 100
in .gdbinit or the debugger initialization commands