User forums > General (but related to Code::Blocks)

Feature Request/Help: GDB Vector, nested vector, and strut viewing.[SOLVED]

(1/6) > >>

PureBlackSin:
Hi guys, I have been searching the internet for a fix to my problem.

I regularly use vectors (who doesn't) and I was surprised to find that I couldn't directly view them in the debugger. Initially I wasn't too bothered and continued, using various workarounds. I also found a few scripts and homemade addons hanging around the internet which could have potentially helped, and if worst came to the worst I'd reboot and use MSVS to view the vectors, etc.

Out of all the "pretty" things you've made Code::Blocks do (all of which I really like), I'm somewhat surprised that this isn't a stock feature...

If this was a feature I could effectively abandon MSVS and Code::Blocks would cover all my needs.

Any chance this is becoming a feature, or is in the pipeline already and I've managed to not find it? I currently get the nightly builds (I did this in the hope that these would have the feature and the stable release was just lacking it..).

Any information on this would be great as I much prefer your IDE over many of the others! This is the only barrier :P

Cheers!

  

ollydbg:
If you gdb is build with python enabled, you have no problem shown vectors.

See:
http://sourceware.org/gdb/wiki/STLSupport

http://forums.codeblocks.org/index.php/topic,11301.msg77000.html#msg77000

as references.

PureBlackSin:
Okay, I probably should have mentioned I'm a Linux/Ubuntu user. I tried for a couple of hours and using my google-foo and still couldn't get it working.

I ran this:

svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python

Created a file in /home called: .gdbinit

Put this in the file:

python
import sys
sys.path.insert(0, '/home/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end

Still no joy :( I'm assuming that the Code::Blocks 8059 SVN nightly build and GDB 7.4-2012.04-0ubuntu2 combo  is python enabled. The GDB change log seems to suggest that it is python enabled, but I just skimmed it for the word python...

Also, still waiting to find out why this isn't all standard.

More help please!

oBFusCATed:
First you need the latest build, because there are some improvements to the way C::B parses the output of GDB.
Then you should disable the "Watch scripts" in the settings of the debugger.
Instead of .gdbinit you can use another file and then you can put "source path_to_file" in the initial commands of the debugger. This works 100%.

Also gcc>=4.5 include the pretty printers in their installation by default, so no additional setup is needed.

PureBlackSin:
Okay, I've disabled Watch scripts.
gcc version: 4:4.6.3-1ubuntu5 | So it doesn't look like it's there by default, I'm assuming there is a tickbox that needs to be ticked.


--- Quote ---you can put "source path_to_file" in the initial commands of the debugger. This works 100%.
--- End quote ---

No idea what you mean by this, I looked though all the options in c::b and couldn't find where I could put this, or what "source path_to_file" should be, is it to the python scripts gained from the SVN checkout? That's what I assumed, still no luck...

Note: just thought I'd point out I'm trying to look at a vector<> of strings.

Navigation

[0] Message Index

[#] Next page

Go to full version