Reduce spam in gdb print

I am using gdb 7.2 with Dan Marinescu configuration, which allows printing lines of STL vectors, etc. (pstring, pvector, etc.). This is not good. Therefore, having examined one of the answers below, I cleaned and used the beautiful printers available in version 7.0 and higher.

For this, I will put the following in my .gdbinit

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

The instructions say to download the code from svn to / home / me / gdb _printers / python, but that was a long time ago. I noticed that the code was in gdb 7.3. So I removed the above and the basics, but stl does not. Here's the object containing the string:

{a = 2, b = 97 'a', c = 2469135780247, d = 1,136363636363636362, e = {static npos = 18446744073709551615, _M_dataplus = {> = {<__ gnu_cxx :: new_allocator> = {},}, _M_p = 0x602028 "foo"}}}

./GDB-7.3.50.20110526/GDB/ //GDB:

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

, , , .

+3
1

, , GDB 7.0 Python pretty printers.

pstring, print ( ).

+1

All Articles