V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
blond
V2EX  ›  Python

python gdb 调试查看变量值

  •  
  •   blond · 2014-03-26 23:31:55 +08:00 · 3940 次点击
    这是一个创建于 3695 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我有一正在运行的python程序,我用gdb调试该程序时,怎么查看当前存在的变量值呢
    5 条回复    1970-01-01 08:00:00 +08:00
    9hills
        1
    9hills  
       2014-03-26 23:42:06 +08:00 via iPad
    https://wiki.python.org/moin/DebuggingWithGdb
    http://blog.log4d.com/2013/11/python-gdb/

    但是有个缺陷,必须以编译了debug 支持的python才行,Ubuntu 下是Python-dbg
    ivanlw
        2
    ivanlw  
       2014-03-27 09:37:29 +08:00
    python不是用pdb调试么……
    judezhan
        3
    judezhan  
       2014-03-27 12:23:28 +08:00
    pdb多好用啊。。。楼主为啥要用gdb?
    mengzhuo
        4
    mengzhuo  
       2014-03-27 21:40:05 +08:00
    ipdb更牛……为何gdb
    blond
        5
    blond  
    OP
       2014-04-01 11:15:24 +08:00
    @ivanlw 因为是我的程序已经在运行了,出现了bug需要查看出现bug的原因,pdb可以调试正在运行的程序么
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3018 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 00:29 · PVG 08:29 · LAX 17:29 · JFK 20:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.