From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jeremy Whitlock Newsgroups: gmane.emacs.bugs Subject: bug#5653: 23.1; pdbtrack isn't parsing valid pdb output or creating an interactive debugging buffer (python.el) Date: Fri, 9 Apr 2010 19:11:49 -0600 Message-ID: <3E20A201-3005-457D-A6AB-2701A421918F@collab.net> References: <87sk8nil35.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: multipart/mixed; boundary=Apple-Mail-8-496933939 X-Trace: dough.gmane.org 1270908959 8806 80.91.229.12 (10 Apr 2010 14:15:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Apr 2010 14:15:59 +0000 (UTC) Cc: Chong Yidong To: 5653@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 10 16:15:57 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O0bTX-0001vF-Dp for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Apr 2010 16:15:55 +0200 Original-Received: from localhost ([127.0.0.1]:45984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0bTW-00045T-Oo for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Apr 2010 10:15:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0PY9-0003n5-8J for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2010 21:31:53 -0400 Original-Received: from [140.186.70.92] (port=49183 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0PY7-0003mC-Ly for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2010 21:31:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0PY5-00075P-OZ for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2010 21:31:51 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47409) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0PY5-00075G-JH for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2010 21:31:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O0PST-0003sn-Q1; Fri, 09 Apr 2010 21:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jeremy Whitlock Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Apr 2010 01:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5653 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5653-submit@debbugs.gnu.org id=B5653.127086274314919 (code B ref 5653); Sat, 10 Apr 2010 01:26:01 +0000 Original-Received: (at 5653) by debbugs.gnu.org; 10 Apr 2010 01:25:43 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0PSA-0003sa-T0 for submit@debbugs.gnu.org; Fri, 09 Apr 2010 21:25:43 -0400 Original-Received: from sp-exchfea.sp.corp.collab.net ([204.16.106.198]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0PEq-0003n0-4r for 5653@debbugs.gnu.org; Fri, 09 Apr 2010 21:11:56 -0400 Original-Received: from [192.168.0.10] ([71.212.141.191]) by sp-exchfea.sp.corp.collab.net with Microsoft SMTPSVC(6.0.3790.3959); Fri, 9 Apr 2010 18:11:50 -0700 In-Reply-To: X-Mailer: Apple Mail (2.1078) X-OriginalArrivalTime: 10 Apr 2010 01:11:50.0931 (UTC) FILETIME=[CCD71E30:01CAD84A] X-Mailman-Approved-At: Fri, 09 Apr 2010 21:25:41 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 09 Apr 2010 21:26:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Sat, 10 Apr 2010 10:15:20 -0400 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36154 Archived-At: --Apple-Mail-8-496933939 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Attached is a patch that fixes this issue. Basically, Python (pdb) is = passing strings to Emacs with ^M in them. My patch, attached and pasted = in this email just in case, strip the carriage return from the string = and after that, pdb starts working as expected. Here is the patch, = generated from "git format-patch": =46rom 375d82016d8bd518603c909b651de16fa1b31b1f Mon Sep 17 00:00:00 2001 From: Jeremy Whitlock Date: Fri, 9 Apr 2010 18:33:15 -0600 Subject: [PATCH] Fixes problem in pdb where no prompt is ever displayed. = (Issue 5653) Python's pdb was outputing strings with the carriage return in them and = the gud pdb regexps were not matching them. This commit removes the = carriage returns and fixes pdb support. --- lisp/progmodes/gud.el | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index da38a08..652a843 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -1575,7 +1575,10 @@ and source-file directory for your debugger." ;; beginning of a marker, we save it here between calls to the ;; filter. (defun gud-pdb-marker-filter (string) - (setq gud-marker-acc (concat gud-marker-acc string)) + ;; Remove \r character from pdb output + (setq tstring (replace-regexp-in-string "\r" "" string)) + + (setq gud-marker-acc (concat gud-marker-acc tstring)) (let ((output "")) =20 ;; Process all the complete markers in this chunk. --=20 1.6.5.3 I wouldn't be surprised if my lisp could be done a different way but I = can confirm that this does fix the issue. Take care, = --------------------------------------------------------------------------= --- Jeremy Whitlock | Software Engineer | CollabNet, Inc. 8000 Marina Blvd. Suite 600 | Brisbane, CA 94005 | USA O 650.228.2516 | C 970.430.5295 | jwhitlock@collab.net --Apple-Mail-8-496933939 Content-Disposition: attachment; filename=0001-Fixes-problem-in-pdb-where-no-prompt-is-ever-display.patch Content-Type: application/octet-stream; name="0001-Fixes-problem-in-pdb-where-no-prompt-is-ever-display.patch" Content-Transfer-Encoding: quoted-printable =46rom=20375d82016d8bd518603c909b651de16fa1b31b1f=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Jeremy=20Whitlock=20=0A= Date:=20Fri,=209=20Apr=202010=2018:33:15=20-0600=0ASubject:=20[PATCH]=20= Fixes=20problem=20in=20pdb=20where=20no=20prompt=20is=20ever=20= displayed.=20=20(Issue=205653)=0A=0APython's=20pdb=20was=20outputing=20= strings=20with=20the=20carriage=20return=20in=20them=20and=20the=0Agud=20= pdb=20regexps=20were=20not=20matching=20them.=20=20This=20commit=20= removes=20the=20carriage=0Areturns=20and=20fixes=20pdb=20support.=0A---=0A= =20lisp/progmodes/gud.el=20|=20=20=20=205=20++++-=0A=201=20files=20= changed,=204=20insertions(+),=201=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/gud.el=20b/lisp/progmodes/gud.el=0Aindex=20= da38a08..652a843=20100644=0A---=20a/lisp/progmodes/gud.el=0A+++=20= b/lisp/progmodes/gud.el=0A@@=20-1575,7=20+1575,10=20@@=20and=20= source-file=20directory=20for=20your=20debugger."=0A=20;;=20beginning=20= of=20a=20marker,=20we=20save=20it=20here=20between=20calls=20to=20the=0A=20= ;;=20filter.=0A=20(defun=20gud-pdb-marker-filter=20(string)=0A-=20=20= (setq=20gud-marker-acc=20(concat=20gud-marker-acc=20string))=0A+=20=20;;=20= Remove=20\r=20character=20from=20pdb=20output=0A+=20=20(setq=20tstring=20= (replace-regexp-in-string=20"\r"=20""=20string))=0A+=0A+=20=20(setq=20= gud-marker-acc=20(concat=20gud-marker-acc=20tstring))=0A=20=20=20(let=20= ((output=20""))=0A=20=0A=20=20=20=20=20;;=20Process=20all=20the=20= complete=20markers=20in=20this=20chunk.=0A--=20=0A1.6.5.3=0A=0A= --Apple-Mail-8-496933939--