Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3634246
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:45:18+00:00 2026-05-19T00:45:18+00:00

I posted this on programmers.stackexchange.com , but I figured it may be more appropriate

  • 0

I posted this on programmers.stackexchange.com, but I figured it may be more appropriate on SO.

I use emacs for all my code edit needs. Typically, I will use M-x compile to run my test runner which I would say gets me about 70% of what I need to do to keep the code on track however lately I’ve been wondering how it might be possible to use M-x pdb on occasions where it would be nice to hit a breakpoint and inspect things.

In my googling I’ve found some things that suggest that this is useful/possible. However I have not managed to get it working in a way that I fully understand.

I don’t know if it’s the combination of buildout + appengine that might be making it more difficult but when I try to do something like

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/

Where …/bin/python is the interpreter buildout makes with the path set for all the eggs.

~/bin/pdb is a simple script to call into pdb.main using the current python interpreter

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 is the dev_appserver script that the buildout recipe makes for gae project and …/parts/hydrant-app is the path to the app.yaml

I am first presented with a prompt

Current directory is /Users/twillis/bin/
C-c C-f

Nothing happens but

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$ 

something is happening

C-x [space]

will report that a breakpoint has been set. But I can’t manage to get get things going.

It feels like I am missing something obvious here. Am I?

So, is interactive debugging in emacs worthwhile? is interactive debugging a google appengine app possible? Any suggestions on how I might get this working?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T00:45:19+00:00Added an answer on May 19, 2026 at 12:45 am

    A specific problem with GAE is that it redirects STDOUT to the browser, including debugger output.

    As outlined in the pdb documentation, the usual workflow is to set a breakpoint in code at the point you need it. Normally you’d do import pdb; pdb.set_trace(), but in the case of GAE, you’ll also want to grab your STDIN and STDOUT. For example, this code snippet:

    def set_trace():
        import pdb, sys
        debugger = pdb.Pdb(stdin=sys.__stdin__, 
            stdout=sys.__stdout__)
        debugger.set_trace(sys._getframe().f_back)
    

    Then start a shell in emacs and run your code from there:

    $ ./bin/devappserver /Users/twillis/projects/hydrant/parts/hydrant-app/
    

    For easy access to the right place in a shell-interaction buffer in emacs, I use poptoshell.el (google it, I don’t have sufficient reputation to add another link)

    Finally, make sure you have a recent enough version of python-mode such that it includes pdbtrack functionality (you almost certainly do, but you definitely want it, as it provides the means to step through code in emacs).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I posted this on programmers first , but was told it belongs here. Funny,
I posted this code a couple days back, but the discussion seemed to wax
I posted this code earlier, but was told to clean it up and repost.
I posted this question: https://stackoverflow.com/questions/418597/java-and-net-for-php-programmer and the answers I was given didn't really help
I posted this very same item on SERVERFAULT, but got no reply. So here
I posted this back in May on the [android-developers] Google Group. I never heard
LearnWPF.com posted this article about converting bitmap images to XAML and using them in
I've posted this here , but thought it might deserve a question on its
I've posted this on django-users but haven't received a reply! So I have my
I had posted this earlier on Stack Overflow, but couldn't get a positive result.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.