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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Greg Novak <greg.novak@HIDDEN>; dated Tue, 29 Jan 2013 17:20:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Jan 2013 17:19:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 29 12:19:11 2013
Received: from localhost ([127.0.0.1]:54603 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1U0Epy-000094-NF
	for submit <at> debbugs.gnu.org; Tue, 29 Jan 2013 12:19:11 -0500
Received: from eggs.gnu.org ([208.118.235.92]:36182)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <greg.novak@HIDDEN>) id 1U0Eo8-000062-Br
	for submit <at> debbugs.gnu.org; Tue, 29 Jan 2013 12:17:17 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <greg.novak@HIDDEN>) id 1U0Enb-0004Br-54
	for submit <at> debbugs.gnu.org; Tue, 29 Jan 2013 12:16:44 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-102.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	HTML_MESSAGE,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,USER_IN_WHITELIST
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:40179)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <greg.novak@HIDDEN>) id 1U0EBv-0001RV-JU
	for submit <at> debbugs.gnu.org; Tue, 29 Jan 2013 11:37:47 -0500
Received: from eggs.gnu.org ([208.118.235.92]:36885)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <greg.novak@HIDDEN>) id 1U0EBi-0000p9-Rc
	for bug-gnu-emacs@HIDDEN; Tue, 29 Jan 2013 11:37:47 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <greg.novak@HIDDEN>) id 1U0EBg-0001MH-2O
	for bug-gnu-emacs@HIDDEN; Tue, 29 Jan 2013 11:37:34 -0500
Received: from mail-qc0-f180.google.com ([209.85.216.180]:46889)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <greg.novak@HIDDEN>) id 1U0EBf-0001M5-Qs
	for bug-gnu-emacs@HIDDEN; Tue, 29 Jan 2013 11:37:31 -0500
Received: by mail-qc0-f180.google.com with SMTP id v28so270902qcm.39
	for <bug-gnu-emacs@HIDDEN>; Tue, 29 Jan 2013 08:37:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:x-received:date:message-id:subject:from:to
	:content-type; bh=YE66UWLpqNggl0x4IW2Muy3aYZpTu8pkR60qstngSMs=;
	b=HTD9AcHgw/IFokVjB8n3JmOhJRCuSVGHWhcvP+XKaGeXEZyeJkguio5gi5L0i8ycLr
	bC1iFGTrVRxxvxy0wDTdRyNgk0atfdYejdz68Mvx1eGihLTeF1K9lttGm0zSmTlgQV2Z
	dmgSsW69+ExDgdeiIpE2/7W2j//vEZj02pnQD+bu0FUVlCoN1ZRoLT5VM7slKLngKuX/
	3Bqkk9Gq2gL5OzZJejfRFmct432S8f8utyKBaNa+ikMCIF8B4yBsKYql/m8KIJNHS3fP
	GeVbOQjlhK12zVSSmYl2dXch6L1avAHWpPLFaB+pRd41BNxBXBRT2/PDu9xo1RHXeeQC
	sRwA==
MIME-Version: 1.0
X-Received: by 10.224.33.140 with SMTP id h12mr1789593qad.73.1359477451219;
	Tue, 29 Jan 2013 08:37:31 -0800 (PST)
Received: by 10.49.58.226 with HTTP; Tue, 29 Jan 2013 08:37:30 -0800 (PST)
Date: Tue, 29 Jan 2013 17:37:30 +0100
Message-ID: <CAPSkGgfup8KOS9X2QRjhfAh-q_P23nwkAyZnrfj=ujStSaVjLA@HIDDEN>
Subject: pdbtrack doesn't jump to the source file location on the first
	exception/set_trace() call
From: Greg Novak <greg.novak@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/mixed; boundary=20cf3074d2228f62e504d47002ce
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 29 Jan 2013 12:19:10 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.1 (------)

--20cf3074d2228f62e504d47002ce
Content-Type: multipart/alternative; boundary=20cf3074d2228f62e104d47002cc

--20cf3074d2228f62e104d47002cc
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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=E1n E. Gallina from the latest development ema=
cs
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

--20cf3074d2228f62e104d47002cc
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I have attached a patch to fix this problem. =A0</div=
><div><br></div><div style>I am using the latest stable version of emacs 24=
.2.1, but with the version of python.el written by Fabi=E1n E. Gallina from=
 the latest development emacs sources.</div>
<div><br></div><div>When running python or ipython under Emacs, when either=
 an exception or a call to pdb.set_trace() is encountered, pdbtrack doesn&#=
39;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 infor=
mation are printed involving the arguments of the present function (see bel=
ow), and the implementation of pdbtrack in python.el requires the stack inf=
ormation to be on the first or second line of the most recent comint output=
. If I type &#39;up&#39;, then &#39;down&#39; to move between the stack fra=
mes, pdbtrack finds the stack frame info and jumps to the source file as de=
sired.</div>
<div><br></div><div>When using IPython, ipdb generally prints an entire sta=
ck trace, so it&#39;s necessary to find the line corresponding to the _last=
_ stack frame printed.</div><div><br></div><div>I have attached a context d=
iff of the change required to fix this behavior so that pdbtrack immediatel=
y jumps to the desired source file, rather than requiring me to type &#39;u=
p&#39; then &#39;down&#39; to move between stack frames so that one and onl=
y one stack frame is printed.</div>
<div><br></div><div style>Below is an example of extra information printed =
when python encounters a call to pdb.set_trace(). =A0pdbtrack requires the =
stack frame to be on the first or second line, but in this case the first a=
nd second lines are &#39;1.1&#39; and &#39;--Return--&#39; =A0(The code in =
question is not printing anything to stdout).</div>
<div style><br></div><div><div>&gt;&gt;&gt; mg.jey()</div><div>1.1</div><di=
v>--Return--</div><div>&gt; /Users/novak/Projects/gsnpy/mg.py(17)gsn()-&gt;=
None</div><div>-&gt; pdb.set_trace()</div><div>(Pdb) up</div></div><div>
<br></div><div><br></div></div>

--20cf3074d2228f62e104d47002cc--
--20cf3074d2228f62e504d47002ce
Content-Type: application/octet-stream; name="python.el.diff"
Content-Disposition: attachment; filename="python.el.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hcj9rcd20

KioqIHB5dGhvbi5lbC5vcmlnCTIwMTMtMDEtMjkgMTM6MTM6NDkuMDAwMDAwMDAwICswMTAwCi0t
LSBweXRob24uZWwJMjAxMy0wMS0yOSAxNzowOTozNC4wMDAwMDAwMDAgKzAxMDAKKioqKioqKioq
KioqKioqCioqKiAyMzIzLDIzMzcgKioqKgogICAgICAgICAgICAgKGZpbGUtbmFtZQogICAgICAg
ICAgICAgICh3aXRoLXRlbXAtYnVmZmVyCiAgICAgICAgICAgICAgICAoaW5zZXJ0IGZ1bGwtb3V0
cHV0KQohICAgICAgICAgICAgICAgKGdvdG8tY2hhciAocG9pbnQtbWluKSkKISAgICAgICAgICAg
ICAgIDs7IE9LLCB0aGlzIHN1Y2tlZCBidXQgbm93IGl0IGJlY2FtZSBhIGNvb2wgaGFjay4gVGhl
CiEgICAgICAgICAgICAgICA7OyBzdGFja3RyYWNlIGluZm9ybWF0aW9uIG5vcm1hbGx5IGlzIG9u
IHRoZSBmaXJzdCBsaW5lCiEgICAgICAgICAgICAgICA7OyBidXQgaW4gc29tZSBjYXNlcyAobGlr
ZSB3aGVuIGRvaW5nIGEgc3RlcC1pbikgaXQgaXMKISAgICAgICAgICAgICAgIDs7IG9uIHRoZSBz
ZWNvbmQuCiEgICAgICAgICAgICAgICAod2hlbiAob3IgKGxvb2tpbmctYXQgcHl0aG9uLXBkYnRy
YWNrLXN0YWNrdHJhY2UtaW5mby1yZWdleHApCiEgICAgICAgICAgICAgICAgICAgICAgICAgKGFu
ZAohICAgICAgICAgICAgICAgICAgICAgICAgICAoZm9yd2FyZC1saW5lKQohICAgICAgICAgICAg
ICAgICAgICAgICAgICAobG9va2luZy1hdCBweXRob24tcGRidHJhY2stc3RhY2t0cmFjZS1pbmZv
LXJlZ2V4cCkpKQogICAgICAgICAgICAgICAgICAoc2V0cSBsaW5lLW51bWJlciAoc3RyaW5nLXRv
LW51bWJlcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1hdGNoLXN0cmlu
Zy1uby1wcm9wZXJ0aWVzIDIpKSkKICAgICAgICAgICAgICAgICAgKG1hdGNoLXN0cmluZy1uby1w
cm9wZXJ0aWVzIDEpKSkpKQotLS0gMjMwMCwyMzE2IC0tLS0KICAgICAgICAgICAgIChmaWxlLW5h
bWUKICAgICAgICAgICAgICAod2l0aC10ZW1wLWJ1ZmZlcgogICAgICAgICAgICAgICAgKGluc2Vy
dCBmdWxsLW91dHB1dCkKISAgICAgICAgICAgICAgIDs7IFdoZW4gdGhlIGRlYnVnZ2VyIGVuY291
bnRlcnMgYSBwZGIuc2V0X3RyYWNlKCkKISAgICAgICAgICAgICAgIDs7IGNvbW1hbmQsIGl0IHBy
aW50cyBhIHNpbmdsZSBzdGFjayBmcmFtZS4gIFNvbWV0aW1lcwohICAgICAgICAgICAgICAgOzsg
aXQgcHJpbnRzIGEgYml0IG9mIGV4dHJhIGluZm9ybWF0aW9uIGFib3V0IHRoZQohICAgICAgICAg
ICAgICAgOzsgYXJndW1lbnRzIG9mIHRoZSBwcmVzZW50IGZ1bmN0aW9uLiAgV2hlbiBpcGRiCiEg
ICAgICAgICAgICAgICA7OyBlbmNvdW50ZXJzIGFuIGV4Y2VwdGlvbiwgaXQgcHJpbnRzIHRoZSBf
ZW50aXJlXyBzdGFjawohICAgICAgICAgICAgICAgOzsgdHJhY2UuICBUbyBoYW5kbGUgYWxsIG9m
IHRoZXNlIGNhc2VzLCB3ZSB3YW50IHRvIGZpbmQKISAgICAgICAgICAgICAgIDs7IHRoZSBfbGFz
dF8gc3RhY2sgZnJhbWUgcHJpbnRlZCBpbiB0aGUgbW9zdCByZWNlbnQKISAgICAgICAgICAgICAg
IDs7IGJhdGNoIG9mIG91dHB1dCwgdGhlbiBqdW1wIHRvIHRoZSBjb3Jyc3BvbmRpbmcKISAgICAg
ICAgICAgICAgIDs7IGZpbGUvbGluZSBudW1iZXIuCiEgICAgICAgICAgICAgICAoZ290by1jaGFy
IChwb2ludC1tYXgpKQohICAgICAgICAgICAgICAgKHdoZW4gKHJlLXNlYXJjaC1iYWNrd2FyZCBw
eXRob24tcGRidHJhY2stc3RhY2t0cmFjZS1pbmZvLXJlZ2V4cCBuaWwgdCkKICAgICAgICAgICAg
ICAgICAgKHNldHEgbGluZS1udW1iZXIgKHN0cmluZy10by1udW1iZXIKICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIChtYXRjaC1zdHJpbmctbm8tcHJvcGVydGllcyAyKSkpCiAg
ICAgICAgICAgICAgICAgIChtYXRjaC1zdHJpbmctbm8tcHJvcGVydGllcyAxKSkpKSkK
--20cf3074d2228f62e504d47002ce--




Acknowledgement sent to Greg Novak <greg.novak@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#13586; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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