[IPython-dev] Debugger patch

Fernando Perez Fernando.Perez at colorado.edu
Sat Dec 3 13:11:57 CST 2005


Hi Vivian,

Vivian De Smedt wrote:
> Hi Fernando,
> 
> I'm in the process a cutting my patch to the IPython code to improve the 
> Python debugger version of the IPython to make it more IPythonic ;-).

Excellent, many thanks for this.  I am in the process of looking over it.  I 
certainly find the final functionality to be a VAST improvement over the 
crippled pdb we get by default, so this will most defintely go in.  I just 
need to look in more detail at the implementation to try to make the 
integration as smooth as possible with the rest of the codebase.

In the meantime, I just wanted to offer you a little bit of practical feedback 
regarding patches, to make the process easier in the future:

- Your email didn't make it to the -dev list because it was ~800kb, which is 
too big for the list.  The reason for this size is that you sent the full 
IPython directory as a zip file, this is unnecessary.  Instead, you can simply 
do in your local copy of IPython

svn diff > vivian_pdb.diff

and attach (zipped, if you want) the .diff file.  That contains all the 
information necessary to apply your changes.  I've attached it here for reference.

- You don't need to mark your changes in the source (# << vivian).  The diff 
shows precisely what has changed, and that way there is no need to later go 
back and remove those marks manually (there is no point in cluttering the code 
in the long run with such markers).

> *The new features*
> 
> The change cover better support for:
> 
>     * the print of the current point of execution
>           o it is now printed the way IPython print traceback
>     * the "where" command
>           o each stack is printed the way IPython print the traceback frames
>           o the IPython stacks level are not printed anymore in the
>             result making the result clearer
>     * the "list" command
>           o the code is printed the way IPython print the traceback
>           o the break point number is printed instead of a simple B
>             (that is nice since it help you to know which break point
>             you should clear or disable)
>           o the disabled breakpoints appear in a different color that
>             the active breakpoints
>     * the code completion works when IPython run in debugger mode
>       (that's nice since it help you to explore more easily the content
>       of the variable to discover why the Exception was raised or why
>       the code is wrong)
> 
> To make it clearer you will find commented screen shot of before and 
> after the change together with the script I have used to produce them.

The functionality is excellent, and many thanks for the clear screenshots with 
your comments on them.  It makes for a really easy way to see what the 
improvements are.  I'll probably reuse them on the website to highlight the 
feature, if you don't mind.

> *Integration*
> 
> In a previous mail we spoke about sending to you this patch into smaller 
> part to help you understanding my changes, be sure that there have no 
> bad impact on existing features and ease the integration into your new code.
> 
> As I said previously only four files where modified three are only 
> slightly modified and one (Debugger.py) widely.
> Actually Debugger.py contains the definition of Debugger.Pdb which is a 
> derivation of pdb.Pdb to override some functions and modify this way 
> some behaviors of Pdb. The patch do not modify existing overriding but 
> add some to customize more behaviors
> 
> The modifications of the other files concerns
> 
>     * using Debugger.Pdb instead of pdb.Pdb,
>     * passing some color information to Debugger.Pdb to let it print the
>       colors the way the user want,
>     * passing some information about the stack levels the debugger
>       should use for the where command
>     * the code completion
> 
> In order to do that I have to choose which are the first feature to 
> integrate into IPython it is a difficult choice. Do you think something 
> about it. What is the part that interest you the most what feature 
> should cover the first patch tell me what you think.

Don't worry, what you sent me is enough.  I have a couple of free hours today 
before I have to work on my floors again, so I'll work on the patch right 
away.  I've kept you 'on hold' long enough that a bit of quick response will 
hopefully be a welcome change :)

Thanks again for these improvements.  I'll get working on the integration, and 
will let you know either when I commit, or if I need to discuss further work 
with you.

Cheers,

f
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdb.diff
Type: text/x-patch
Size: 14833 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/ipython-dev/attachments/20051203/bc242742/attachment.bin 


More information about the IPython-dev mailing list