gdb Python预打印机不能与MinGW Windows一起使用

2024-09-27 04:23:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我按照说明安装了下面网站中提到的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一起工作吗?


Tags: 文件thetopathorgprojectautoyour
1条回答
网友
1楼 · 发布于 2024-09-27 04:23:52

事实证明,安装的MinGW版本没有启用Python。 要检查gdb是否启用了Python,请在gdb中执行以下命令:

(gdb) python print sys.version

如果它不支持Python,请从他们的网站安装MingW-W64-builds
http://mingw-w64.org/doku.php/download
这个版本的MinGW支持Python

确保系统上安装了Python 2.7。
更新.gdbinit文件时,Python漂亮的打印机必须在Windows上工作

相关问题 更多 >

    热门问题