I encounterd a bug of gdb on startup saying "Error while executing Python code."
For a simple helloworld C++ program,
E:\helloworld> g++ -g hello.cpp
E:\helloworld> gdb .\a.exe
GNU gdb (GDB) 7.9.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Traceback (most recent call last):
File "<string>", line 4, in <module>
File "e:\mingw-w64\i686-5.1.0-posix-dwarf-rt_v4-rev0\mingw32\share\gdb/python/../../gcc-5.1.0/python/libstdcxx/v6/printers.py", line 1266, in register_libstdcxx_printers
gdb.printing.register_pretty_printer(obj, libstdcxx_printer)
File "e:\mingw-w64\i686-5.1.0-posix-dwarf-rt_v4-rev0\mingw32\share\gdb/python/gdb/printing.py", line 152, in register_pretty_printer
printer.name)
RuntimeError: pretty-printer already registered: libstdc++-v6
e:\mingw-w64\i686-5.1.0-posix-dwarf-rt_v4-rev0\mingw32\bin../etc/gdbinit:6: Error in sourced command file:
Error while executing Python code.
Reading symbols from .\a.exe...done.
(gdb) quit
My gdb version is:
E:helloworld> gdb -v
GNU gdb (GDB) 7.9.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word".
This bug fixed; thank you very much for taking the time to solve it.
Currently my using gdb is 7.10.1 of mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0.