[Zope] Weird PDB behavioramounts to canonic filename problem
Andrew Athan
aathan-zope-list%REMOVEME@memeplex.com
Wed, 11 Apr 2001 17:08:21 -0400
Does anyone have a clever way to fix this problem?
Many of my breakpoints were not being hit. Turns out the reason is that
there is a hodge-podge of different forms for the filenames reported in
stack frames. I've seen
D:/LongNameThing\file.py
d:\LONGNA~1\file.py
d:/LongNameThing\file.py
D:\LONGNA~1\file.py
This causes bdb.py's break_here function not to hit lots of good stuff,
since emacs's gud's C-x b always uses the right form. By the way, put this
in your .emacs ;-)
There is a hook in bdb for a function called canonic() which is used to
canonicalize all filenames. I can write it, but if someone has it already
that'd be great. My debugging would run faster if there were some way to
make sure that all .pyc's and/or .py's got the same filename format when
executing. I don't have time to look into this. Is there any magic someone
can incant for me?
(add-hook 'pdb-mode-hook (function (lambda () (gud-def gud-break "break
%d%f:%l" "\C-b" "Set breakpoint at current line."))))