eclipse调试C++代码报错: Could not determine GDB version using command: gdb --version

来源:互联网 发布:淘宝店铺地址怎么设置 编辑:程序博客网 时间:2024/06/04 18:31
$ gdbGNU gdb (GDB) 7.11.1Copyright (C) 2016 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 "x86_64-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 3, in <module>ImportError: No module named libstdcxx.v6.printersd:\msyq64\mingw64\bin\../etc/gdbinit:5: Error in sourced command file:Undefined command: "".  Try "help".(gdb) q


按照报错提示,打开d:\msyq64\mingw64\bin\../etc/gdbinit看了下内容:

pythonimport syssys.path.insert(0, sys.path[0] + '/../../gcc-5.3.0/python')from libstdcxx.v6.printers import register_libstdcxx_printersregister_libstdcxx_printers (None)end

可疑的是里面有gcc版本号,于是我看了一下我当前gcc的版本号:

$ gcc -vUsing built-in specs.COLLECT_GCC=D:\msys64\mingw64\bin\gcc.exeCOLLECT_LTO_WRAPPER=D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/lto-wrapper.exeTarget: x86_64-w64-mingw32Configured with: ../gcc-6.1.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev1, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ldThread model: posixgcc version 6.1.0 (Rev1, Built by MSYS2 project)

发现并不是5.3.0,于是尝试将d:\msyq64\mingw64\bin\../etc/gdbinit中的gcc-5.3.0改成gcc-6.1.0,然后再将执行了一下gdb:

$ gdbGNU gdb (GDB) 7.11.1Copyright (C) 2016 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 "x86_64-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".(gdb)

居然好了,特将此记录,供各位参考。








0 0
原创粉丝点击