PyDev Breakpoints in App Engine 1.7.6 broken?

2019-02-04 14:50发布

问题:

I just upgraded to the App Engine 1.7.6 SDK for my python app and realised that breakpoints no longer work in PyDev (Eclipse plugin) when using the new dev_appserver.py.

Does anyone know of a way of enabling them again? I assume the new server is spawning a new process for the web server, and the debugger isn't attaching to that one. I'm not sure how to configure it to do that though.

In the meantime I am using the old_dev_appserver.py server.

回答1:

UPDATE 2012-07-27:

Following the comment, I verified, the issue is solved after updating to PyDev. 2.8 and App Engine 1.8.2

OBSOLETE:

I found the following analysis of the problem at googleappengine issues tracker

The reason why PDB doesn't work is because dev_appserver is using stdin/stdout for interprocess communication. Python has built-in libraries for IPC: http://docs.python.org/2/library/ipc.html. dev_appserver should use these, and then stdin/stdout can be left alone so that PDB still works.

So it seems that there is no workaround, rather than reverting to use old_dev_appserver.py

UPDATE 2013-04-23: Inability to debug is annoying. Many developers complain about it

  1. PyDev Breakpoints in App Engine 1.7.6 broken?
  2. https://groups.google.com/forum/?fromgroups=#!topic/google-appengine/ep5BWYKpQpU
  3. https://groups.google.com/forum/?fromgroups=#!topic/google-appengine/TCQuJpF44cY
  4. https://code.google.com/p/appengine-devappserver2-experiment/issues/detail?id=28
  5. https://code.google.com/p/googleappengine/issues/detail?id=9012

I am keeping track of the development of this issue here: http://goo.gl/XRU01



回答2:

Yep, ran into the same problem.

Open your Run/Debug Configuration and set the Main Module to:

${GOOGLE_APP_ENGINE}/old_dev_appserver.py


回答3:

Do you mean pdb.set_trace() isn't working?

Look for the function MonkeyPatchPdb() in google/appengine/tools/dev_appserver.py

Run that somewehere in your own project before you use pdb and it should fix it.