Pretty-printing improvements, GDB requirements

Vladimir Prus ghost at cs.msu.su
Fri Sep 18 09:57:01 BST 2009


As you have probably know, some work to finish pretty-printing
support in KDevelop/GDB was going on recently. The changes
are now merged to GDB CVS, and KDevelop is adjusted accordingly.
You need GDB CVS state as of 2009-09-18 to take advantage of
this. 

The primary changes here are:

- KDevelop will notice when childrens are added and removed. So,
if you step over push_back call on std::vector, KDevelop will
notice
- We use incremental fetch of variable children. It means that
if you point KDevelop on std::vector that is not initialized,
it will fetch 5 children, as opposed to trying to fetch all
2^32 or other random value (and not getting back to you in
reasonable time).

Here's a quick recap of what you need to visualize STL structures:

1. SVN HEAD of kdevelop.
2. CVS HEAD of GDB. Make sure this gdb in first in PATH.
3. In some directory, do:

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

4. Add the following to your ~/.gdbinit:

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

Adjust the path to point at the 'python' directory created in '3'.

This is still very early functionality, so I'd appreciate as much testing
as possible. Should there be bugs, report them to me either via this mailing
list, or on IRC.

HTH,
Volodya




More information about the KDevelop mailing list