python - Fedora 19 Pyclewn 找不到GDB版本

标签 python vim gdb fedora

如何让 pyclewn 获得我的 gdb 版本?

[mehoggan@localhost emulator]$ pyclewn
gdb  CRITICAL response to "show version":
***START***
=thread-group-added,id="i1"
~"GNU gdb (GDB) Fedora (7.6-32.fc19)\n"
~"Copyright (C) 2013 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"x86_64-redhat-linux-gnu\".\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
***END***


vim  CRITICAL 
Exception in pyclewn:

<class 'clewn.ClewnError'>
"cannot find the gdb version"
source line: "raise ClewnError('cannot find the gdb version')"
at /usr/lib64/python2.7/site-packages/clewn/gdb.py:340

pyclewn aborting...


[mehoggan@localhost emulator]$ gdb --version
GNU gdb (GDB) Fedora (7.6-32.fc19)
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 "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

最佳答案

我在我的 Red Hat box 上遇到了同样的问题。我通过转到引用的文件和行号来修复它:/usr/lib64/python2.7/site-packages/clewn/gdb.py:340 并进行以下修复:

从第 328 行开始:

            version = ''.join(takewhile(lambda x: x.isdigit() or x == '.',
            version[1]))

并将其更改为:

            version = ''.join(takewhile(lambda x: x.isdigit() or x == '.',
            version[1][1:]))

问题在于它如何处理版本字符串中的第一个 '(' 字符:

[root@localhost ~ 03:52 PM] $ gdb -v

GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-42.el5)
Copyright (C) 2009 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-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

它只使用了这个输出的第一行:

GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-42.el5)

通过在 version[1] 之后添加 [1:],我告诉脚本无条件地跳过第一个字符,这在我的机器上,需要发生。这可能不是一个长期解决方案,但它让我的 pyclewn 工作 =)

关于python - Fedora 19 Pyclewn 找不到GDB版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18157954/

相关文章:

python - 提交表单后重定向到其他 View

Vim:突出显示 incsearch 中的所有匹配项

regex - VI正则表达式-使用当前行号替换

python - 用于扩展的 Gdb 7.10 Python 版本

qt - Qt 上的 "GLib-ERROR **: Cannot create pipe main loop wake-up: Too many open files"

c++ - 如何在执行应用程序时获取已用内存量

python - sudo -E 不通过 PYTHONPATH

python - 根据组过滤 DataFrame 行

php - Python-ModuleNotFoundError : No module named 'selenium'

vim - 有没有办法让 v$y 在 Mac 和 Linux 上的 Vim 中不复制换行符?