GNU bug report logs - #13586
pdbtrack doesn't jump to the source file location on the first exception/set_trace() call

Previous Next

Package: emacs;

Reported by: Greg Novak <greg.novak <at> gmail.com>

Date: Tue, 29 Jan 2013 17:20:01 UTC

Severity: normal

Tags: patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Greg Novak <greg.novak <at> gmail.com>
To: 13586 <at> debbugs.gnu.org
Subject: bug#13586: pdbtrack doesn't jump to the source file location on the first exception/set_trace() call
Date: Tue, 29 Jan 2013 17:37:30 +0100
[Message part 1 (text/plain, inline)]
I have attached a patch to fix this problem.

I am using the latest stable version of emacs 24.2.1, but with the version
of python.el written by Fabián E. Gallina from the latest development emacs
sources.

When running python or ipython under Emacs, when either an exception or a
call to pdb.set_trace() is encountered, pdbtrack doesn't immediately jump
to the appropriate line of the offending source file. In the case of
pdb.set_trace(), this is because a few extra lines of information are
printed involving the arguments of the present function (see below), and
the implementation of pdbtrack in python.el requires the stack information
to be on the first or second line of the most recent comint output. If I
type 'up', then 'down' to move between the stack frames, pdbtrack finds the
stack frame info and jumps to the source file as desired.

When using IPython, ipdb generally prints an entire stack trace, so it's
necessary to find the line corresponding to the _last_ stack frame printed.

I have attached a context diff of the change required to fix this behavior
so that pdbtrack immediately jumps to the desired source file, rather than
requiring me to type 'up' then 'down' to move between stack frames so that
one and only one stack frame is printed.

Below is an example of extra information printed when python encounters a
call to pdb.set_trace().  pdbtrack requires the stack frame to be on the
first or second line, but in this case the first and second lines are '1.1'
and '--Return--'  (The code in question is not printing anything to stdout).

>>> mg.jey()
1.1
--Return--
> /Users/novak/Projects/gsnpy/mg.py(17)gsn()->None
-> pdb.set_trace()
(Pdb) up
[Message part 2 (text/html, inline)]
[python.el.diff (application/octet-stream, attachment)]

This bug report was last modified 4 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.