【发布时间】:2010-12-27 23:11:13
【问题描述】:
我在programmers.stackexchange.com 上发布了这个,但我认为它可能更适合 SO。
我使用 emacs 来满足我所有的代码编辑需求。通常,我会使用 M-x compile 来运行我的测试运行程序,我会说这可以让我完成大约 70% 的工作来保持代码正常运行,但是最近我一直想知道如何使用 M-x pdb on打断点并检查东西会很好的场合。
在我的谷歌搜索中,我发现some things 表明这是有用/可能的。但是,我还没有设法让它以我完全理解的方式工作。
我不知道是不是 buildout + appengine 的组合可能使它变得更加困难,但是当我尝试做类似的事情时
M-x pdb
Run pdb (like this): /Users/twillis/projects/hydrant/bin/python /Users/twillis/bin/pdb /Users/twillis/projects/hydrant/bin/devappserver /Users/twillis/projects/hydrant/parts/hydrant-app/
其中 .../bin/python 是解释器构建使用为所有鸡蛋设置的路径。
~/bin/pdb 是一个使用当前 python 解释器调用 pdb.main 的简单脚本
HellooKitty:hydrant twillis$ cat ~/bin/pdb
#! /usr/bin/env python
if __name__ == "__main__":
import sys
sys.version_info
import pdb
pdb.main()
HellooKitty:hydrant twillis$
.../bin/devappserver 是构建配方为 gae 项目制作的 dev_appserver 脚本,.../parts/hydrant-app 是 app.yaml 的路径
我首先得到一个提示
Current directory is /Users/twillis/bin/
C-c C-f
什么都没有发生,但是
HellooKitty:hydrant twillis$ ps aux | grep pdb
twillis 469 100.0 1.6 168488 67188 s002 Rs+ 1:03PM 0:52.19 /usr/local/bin/python2.5 /Users/twillis/projects/hydrant/bin/python /Users/twillis/bin/pdb /Users/twillis/projects/hydrant/bin/devappserver /Users/twillis/projects/hydrant/parts/hydrant-app/
twillis 477 0.0 0.0 2435120 420 s000 R+ 1:05PM 0:00.00 grep pdb
HellooKitty:hydrant twillis$
有事发生
C-x [space]
将报告已设置断点。但我无法让事情顺利进行。
感觉好像我在这里遗漏了一些明显的东西。我是吗?
那么,emacs 中的交互式调试值得吗?是否可以交互式调试 google appengine 应用程序?关于如何让这个工作的任何建议?
【问题讨论】:
标签: python google-app-engine emacs