all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jeremy Whitlock <jwhitlock@collab.net>
To: 5653@debbugs.gnu.org
Cc: Chong Yidong <cyd@stupidchicken.com>
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	[thread overview]
Message-ID: <3E20A201-3005-457D-A6AB-2701A421918F@collab.net> (raw)
In-Reply-To: <A8A281DA-F64F-4F84-84EF-33185747960E@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]

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":


From 375d82016d8bd518603c909b651de16fa1b31b1f Mon Sep 17 00:00:00 2001
From: Jeremy Whitlock <jcscoobyrs@gmail.com>
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 ""))
 
     ;; Process all the complete markers in this chunk.
-- 
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



[-- Attachment #2: 0001-Fixes-problem-in-pdb-where-no-prompt-is-ever-display.patch --]
[-- Type: application/octet-stream, Size: 1183 bytes --]

From 375d82016d8bd518603c909b651de16fa1b31b1f Mon Sep 17 00:00:00 2001
From: Jeremy Whitlock <jcscoobyrs@gmail.com>
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 ""))
 
     ;; Process all the complete markers in this chunk.
-- 
1.6.5.3


  reply	other threads:[~2010-04-10  1:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26 21:09 bug#5653: 23.1; pdbtrack isn't parsing valid pdb output or creating an interactive debugging buffer (python.el) Jeremy Whitlock
2010-02-27  0:22 ` Chong Yidong
2010-03-01 23:46   ` Jeremy Whitlock
2010-04-10  1:11     ` Jeremy Whitlock [this message]
2010-04-10  1:30       ` Jeremy Whitlock
2010-05-10 17:03       ` Jeremy Whitlock
2010-05-10 20:52         ` Chong Yidong
2010-05-10 20:54           ` Jeremy Whitlock
2011-03-29 17:45 ` bug#5653: gud.el / How To fix pdb in Emacs on Mac OS X (solution) Markus Heiser
2011-06-27 21:38   ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E20A201-3005-457D-A6AB-2701A421918F@collab.net \
    --to=jwhitlock@collab.net \
    --cc=5653@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.