App Engine, Eclipse and Pydev Great but how to get breakpoints???

153 views
Skip to first unread message

Tom Brander

unread,
Jan 25, 2009, 5:47:00 PM1/25/09
to Google App Engine
I've been struggling with trying to debug modifications to the Bloog
sample app, not knowing any of the tools, so I find an issue get a
tool....

Finally got Eclipse and Pydev going, boy I wish I had gotten that
going earlier, much smoother handling than Notepad++!!! Plus now I can
run in a better runtime setup. I've been using some of Eclipse for
report writing (Brit).
Should have gotten on it sooner.
But!!! I can't get breakpoints and variable watching to work on the
App code...(using the Dev server) It displays the symbol, but never
hits.. same with the variable watch, always says "can't evaluate" I
know it's executing the code. I've got it right up in the start on
Main.py....Ideas anyone???
I'm running in debug mode and have followed all the install tutorials
I could find including the one on IBM's site. I'm excited by the
possibility but short on full results.

If I can get this I'll really be able to get some traction I think.

Faber Fedor

unread,
Jan 25, 2009, 10:10:26 PM1/25/09
to google-a...@googlegroups.com
My app just sends and receives JSON, so here's what I do: I run my app in debug mode and then drop to the command line and send JSON code via curl (I'm on a Linux box).  Works great.

You should be able to set a breakpoint, fire up a browser and do whatever it is you do and the breakpoint should break.   

How do you "know" it's running properly? It sounds as if you're doing a "Run As..." instead of "Debug As...".
--

Faber Fedor
Cloud Computing New Jersey
http://cloudcomputingnj.com

Tom Brander

unread,
Jan 26, 2009, 1:26:04 PM1/26/09
to Google App Engine
FWIW The Eclipse environment is massively helpful for app engine even
if I can't get it all to work...

Well I just went back and retried everything slowly and with the
benefit of more sleep.

I'm definitely in debug mode since I see that from a pydev message on
the console, I get a lot more and better logging, although that could
also be from the SDK update this morning from Google, But no how no
way can I get a break point to work. Any help appreciated. Does anyone
have it working when running the dev server, and break pointing
applications Python code??

Tom Brander

unread,
Jan 26, 2009, 3:52:12 PM1/26/09
to Google App Engine
Comments anyone???
Per the Pydev developer on his support site:

Unfortunately, I don't know enough of the App Engine to say the actual
problem, so, I have to get it, create an account and do an example to
know what can be failing there...

A common problem in web frameworks (django, turbogears, etc) is that
there is usually a 2nd process spawned to run things when your files
change, so, for the debugger to work properly you have to run with --
no-reload (or some option close to it), or use the remote debugger
http://fabioz.com/pydev/manual_adv_remote_debugger.html ), but I'm not
sure if that's true for the app engine.

The problem with the post vs the bug is that I can forget to answer
you (as I won't be able to go on and get an app engine example running
here right now).

Youngfe

unread,
Jan 30, 2009, 8:30:07 AM1/30/09
to Google App Engine
As I see, pyscripter is great for developing python app!

On Jan 27, 4:52 am, dartdog <tombran...@gmail.com> wrote:
> Comments anyone???
> Per the Pydev developer on his support site:
>
> Unfortunately, I don't know enough of the App Engine to say the actual
> problem, so, I have to get it, create an account and do an example to
> know what can be failing there...
>
> A common problem in web frameworks (django, turbogears, etc) is that
> there is usually a 2nd process spawned to run things when your files
> change, so, for the debugger to work properly you have to run with --
> no-reload (or some option close to it), or use the remote debuggerhttp://fabioz.com/pydev/manual_adv_remote_debugger.html), but I'm not

Ian Lewis

unread,
Jan 30, 2009, 9:00:53 AM1/30/09
to google-a...@googlegroups.com
Have you tried using pdb? Simon Willison talked about it in his blog a long time ago. I use it off and on and it's pretty adequate.

http://simonwillison.net/2008/May/22/debugging/

2009/1/30 Youngfe <ywfe...@gmail.com>



--
=======================================
株式会社ビープラウド  イアン・ルイス
〒150-0012
東京都渋谷区広尾1-11-2アイオス広尾ビル604
email: ianm...@beproud.jp
TEL:03-5795-2707
FAX:03-5795-2708
http://www.beproud.jp/
=======================================

Faber Fedor

unread,
Jan 30, 2009, 9:40:03 AM1/30/09
to google-a...@googlegroups.com
I just tested this and it works:

1. Create a New Project in Eclipse.  Call it Test-Server.  Put the two files listed below in Test-server/src
2. Create a Run/Debug configuration in Eclipse. Name it "Test-Server".
3. In the Main Tab of the above configuration panel, set your Main Module to something like this:
    ${workspace_loc:test-server/google_appengine/dev_appserver.py}

where "test-server" is the project directory.  Note that I have the appengine code in the same workspace directory, YMMV

4. Under the Arguments tab, put the following in the Arguments text area:
     ${project_loc}/src
     --port=9999

5. Save the configuration.

6.  Open up test-server.py in an editor.  Put a breakpoint on the line
            self.response.out.write("This is the Main Page.")

by double-clicking in the leftmost margin.

7. Select "Debug As..." from the menu.  Select "Test-server".

8. Fire up a browser and go to http://localhost:9999

9. Switch back to Eclipse and you should be in the Debug Perspective with the breakpointed line highlighted.

File 1: app.yaml
application: test-server
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
  script: test_server.py

File 2: test-server
import os
import sys
import cgi
import string

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app



class MainPage(webapp.RequestHandler):
  def get(self):
    self.response.out.write("This is the Main Page.")


application = webapp.WSGIApplication(
                                     [('/'      , MainPage),                            
                                     ],
                                     debug=True)

def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()
========================= EOF=====================
Reply all
Reply to author
Forward
0 new messages