Record my GDB configurations
I. To better display the STL container in GDB, We need to download a python script first.
PS: Make sure that the GDB you installed can execute the python script.
Cd ~ Mkdir. gdbcd. gdbsvn co svn: // gcc.gnu.org/svn/gcc/trunk/libstdc##-v3/python
2. Modify the. gdbinit file in the user directory (copy the following text)
# The python script pythonimport sys executed to better display the STL container in GDB # qch is my username. You can modify sys according to your username. path. insert (0, '/home/qch /. gdb/python ') from libstdcxx. v6.printers import register_libstdcxx_printersregister_libstdcxx_printers (None) end # Open the array display, set print array on # Make GDB display the struct set print pretty on more beautifully # explicitly display the consortium Data set print union on # Let GDB follow the virtual Method the called rule displays the output set print object on
Success