GNU bug report logs - #5653
23.1; pdbtrack isn't parsing valid pdb output or creating an interactive debugging buffer (python.el)

Previous Next

Package: emacs;

Reported by: Jeremy Whitlock <jcscoobyrs <at> gmail.com>

Date: Fri, 26 Feb 2010 21:16:02 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 5653 <at> debbugs.gnu.org (full text, mbox):

From: Jeremy Whitlock <jwhitlock <at> collab.net>
To: 5653 <at> debbugs.gnu.org
Cc: Chong Yidong <cyd <at> stupidchicken.com>
Subject: Re: 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 part 1 (text/plain, inline)]
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 <at> 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 <at> collab.net


[0001-Fixes-problem-in-pdb-where-no-prompt-is-ever-display.patch (application/octet-stream, attachment)]

This bug report was last modified 14 years and 3 days ago.

Previous Next


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