unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5653: 23.1; pdbtrack isn't parsing valid pdb output or creating an interactive debugging buffer (python.el)
@ 2010-02-26 21:09 Jeremy Whitlock
  2010-02-27  0:22 ` Chong Yidong
  2011-03-29 17:45 ` bug#5653: gud.el / How To fix pdb in Emacs on Mac OS X (solution) Markus Heiser
  0 siblings, 2 replies; 10+ messages in thread
From: Jeremy Whitlock @ 2010-02-26 21:09 UTC (permalink / raw)
  To: 5653

Python debugging with gud-pdb appears to be broken.  There are actually two problems:


1) While debugging Python code in emacs I kept seeing "Traceback cue not found" errors popping up in the minibuffer.  After a good bit of googling, I found this:

https://bugs.launchpad.net/python-mode/+bug/505295

Once I applied this patch, those errors went away.  Here is the patch:

--- a/python.el	2010-02-26 13:47:13.000000000 -0700
+++ b/python.el	2010-02-26 13:47:38.000000000 -0700
@@ -575,7 +575,7 @@
(defvar python-pdbtrack-is-tracking-p nil)

(defconst python-pdbtrack-stack-entry-regexp
-  "^> \\(.*\\)(\\([0-9]+\\))\\([?a-zA-Z0-9_]+\\)()"
+  "^> \\(.*\\)(\\([0-9]+\\))\\([?a-zA-Z0-9_<>]+\\)()"
   "Regular expression pdbtrack uses to find a stack trace entry.")

(defconst python-pdbtrack-input-prompt "\n[(<]*[Pp]db[>)]+ "

2) Debugging Python in emacs doesn't work with "M-x pdb".  If I invoke pdb using "M-x pdb", I end up at a buffer that says:

Current directory is <pwd>

No matter what I do, the buffer never updates or creates an interactive pdb shell until I kill the debugging session by running to the end of the script or killing the debugger session.  It's at this point I see exactly what I would had expected to see in the first place, the pdb interactive session and its output.  The only way I can debug Python in emacs is to open a shell, invoke "python -m pdb <file>".  The good news is python.el has support to automatically link the shell's pdb output to an editor pointing to the file being debugged.

In the end, with the patch applied, I can debug by manually invoking pdb from a shell buffer (M-x shell) but even with that patch applied, pdb (M-x pdb) support fails to work as described earlier.  I think issue #1 can be fixed with the inline patch, as it does make it so you can debug Python in emacs where you cannot without the patch being applied.  Please let me know if there is more information I can provide.

Environment Information
---------------------------------
Emacs: 23.1.1 (http://emacsformacosx.com/)
OS: Mac OS X 10.6.2 (Snow Leopard)
Python: 2.6.1

In GNU Emacs 23.1.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
of 2009-08-16 on black.local
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--with-ns''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o r t - e m a <tab> <return>

Recent messages:
Loading /Users/jwhitlock/.emacs.d/color-theme/themes/color-theme-example.el (source)...done
Loading /Users/jwhitlock/.emacs.d/color-theme/themes/color-theme-library.el (source)...done
Loading /Users/jwhitlock/.emacs.frameg...done
For information about GNU Emacs and the GNU system, type C-h C-a.

Jeremy Whitlock <jcscoobyrs@gmail.com>
http://www.thoughtspark.org











^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-06-27 21:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).