[Patches] [ python-Patches-643835 ] Set Next Statement for Python debuggers

noreply@sourceforge.net noreply@sourceforge.net
Mon, 25 Nov 2002 15:18:21 -0800


Patches item #643835, was opened at 2002-11-25 23:18
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=643835&group_id=5470

Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Richie Hindle (richiehindle)
Assigned to: Nobody/Anonymous (nobody)
Summary: Set Next Statement for Python debuggers

Initial Comment:
"Set Next Statement", aka "Jump", for Python debuggers.

For Python 2.3a0 on all platforms (built and tested in Win98).

This patch adds the ability for Python debuggers (including
pdb) to control which line of code in a frame will be executed
next.  This allows the user to jump back and execute code
again, or jump forward to skip code that he doesn't want to
run.  A debugger (or anything else that installs a trace
function) does this by setting the value of frame.f_lineno
from within a trace function.

There are some situations where you can't jump because it
would break the stack - these are caught and a ValueError
is raised.

There are other cases where the jump *is* possible but the
stack needs fixing up, and the code does that.

The patch includes:

 o A setter for frame.f_lineno, in frameobject.c
 o A new command 'j(ump) <line number>' for pdb.
 o Tests in test_trace.py for all the allowed and disallowed
   types of jumps.
 o Updated documentation for pdb and frame objects.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=643835&group_id=5470