Hi Toby, 

You still here?  I'm finally trying (again) to get debugging going.

On Mon, 22 Nov 2004, McLaughlin, Toby wrote:

> Thanks Marilyn,
> 
> Debugging in emacs is obviously not the hottest topic around here.
> 
> Luckily, I have something working now.  For anyone who is interested,
> here is the trick:
> 
> 1. Add the following to your program:
>       import pdb
>       pdb.set_trace()
> 2. Start an interactive Python buffer (C-c !)

This doesn't seem to do anything.  But, when I run my program, after
following step 1.,  I'm in the debugger.  And it is a beautiful sight.

> 3. Run your program (I use C-c C-c)
> 
> Emacs picks up the line numbers from set_trace() and marks the
> appropriate line in the source buffer.  You can now type 'n' to single
> step, as well as issue any of the pdb commands mentioned here:
> http://tinyurl.com/3na4u .

If I set a breakpoint, then 'c'/'continue' doesn't work.  Instead of
continuing, it only goes one step.

If I don't set a breakpoint, then continue does work.  But that's no
use.

> 
> The only trouble I have now is that the Python buffer and my source code
> keep switching places from top to bottom.  A minor annoyance that
> hopefully I will rectify soon.

This doesn't happen to me.

I am using regular ole raw emacs, on a plain terminal, no X.  Are you?

How are you doing with this?  I could sure use a debugger.

Marilyn

> 
> Toby McLaughlin.
> 
> > -----Original Message-----
> > From: Marilyn Davis [mailto:[EMAIL PROTECTED] 
> > Sent: Saturday, 20 November 2004 9:28 AM
> > To: McLaughlin, Toby
> > Cc: tutor@python.org
> > Subject: Re: [Tutor] Debugging in emacs
> > 
> > 
> > On Fri, 19 Nov 2004, McLaughlin, Toby wrote:
> > 
> > > Hi All,
> > > 
> > > Could somebody suggest a way to debug python in emacs?  I'd 
> > like to be
> > > able to single-step while seeing the code marked in some way and
> > > possiblly set breakpoints.  I read about using pdb from the 
> > command line
> > > but would love to have debugging integrated in emacs.  
> > Perhaps I should
> > > make life easy for myself and use one of the fancy GUI 
> > editors, but I
> > > think it's character building for me to learn emacs.
> > 
> > Boy, you could hear a pin drop on this topic.
> > 
> > I use emacs, even though I have spent some time with idle, because I
> > like it much better.  I'm real handy in emacs though, and I don't like
> > mousing.  Mice cause lots of repetitive stress injury.
> > 
> > I spent some time and some email conversations trying to make use of
> > the debugger in any environment.  I don't remember what happened
> > exactly but I gave up.
> > 
> > The thing about an interpreted language is that you can say "print
> > my_var" in the code instead of in the debugger.  And with emacs, I go
> > back and forth between my code and the emacs shell to run it.  I'm
> > pretty efficient that way.
> > 
> > If anyone has any suggestions about debugging, in idle or anywhere, I
> > too would love to hear them.
> > 
> > Thank you.
> > 
> > Marilyn Davis
> > 
> > 
> > > 
> > > Thanks,
> > > Toby McLaughlin.
> > > _______________________________________________
> > > Tutor maillist  -  Tutor@python.org
> > > http://mail.python.org/mailman/listinfo/tutor
> > > 
> > 
> > -- 
> > 
> > 
> 

-- 

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to