我按照说明安装了下面网站中提到的PythonPretty打印机。 https://sourceware.org/gdb/wiki/STLSupport
我在E:\Project
目录中签出了python模块。我创建了一个.gdbinit
文件,并用E:\Project\python
替换路径,最后将该文件放在C:\Users\username
文件夹中。(我甚至试着把它放在当前的工作目录E:\Project
)
无论哪种情况,我似乎都得到了以下信息:
PS E:\Project> gdb .\practise
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 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 "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from E:\Project\practise.exe...done.
warning: File "E:\Project\.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path E:\Project\.gdbinit
line to your configuration file "$HOME/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "$HOME/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
我尝试在.gdbinit
文件中添加行set auto-load safe-path /
,但它仍然显示相同的消息
关于MinGW的漂亮打印机的帖子很少。下面帖子中提到的方法也不起作用。 How do I load .gdbinit on gdb startup?
有人能帮我让Python pretty打印机在Windows上与MinGW一起工作吗?
事实证明,安装的
MinGW
版本没有启用Python。 要检查gdb
是否启用了Python,请在gdb
中执行以下命令:如果它不支持Python,请从他们的网站安装
MingW-W64-builds
:http://mingw-w64.org/doku.php/download
这个版本的
MinGW
支持Python确保系统上安装了Python 2.7。
更新
.gdbinit
文件时,Python漂亮的打印机必须在Windows上工作相关问题 更多 >
编程相关推荐