On 5/12/2010 1:42 PM, Joel Koltner wrote:
Just curious... in Microsoft's Visual Studio (and I would presume some
other tools), for many languages (both interpreted and compiled!)
there's an "edit and conitnue" option that, when you hit a breakpoint,
allows you to modify a line of code before it's actually executed.

Does any Python debugger support this feature? Being an interpreted
language it doesn't seem like it would necessarily be too onerous to
support? It'd be quite handy in that, especially if you hit a breakpoint
due to the interpreter throwing an error, you could fix just the line in

CPython compiles Python code (a sequence of statements) to its private bytecode (a sequence of codes and operands) and then interprets the bytecode. So 'edit and continue' would have to recompile the statement and patch the result into the bytecode. Since function compilation depends on global analysis of the function, functions would have to be recompiled as a whole.

Another problem is recovery of state. If an exception is raised in the middle of a statememt, there would need to be a means to roll back the state of objects and namespaces to what they were before execution of the statement started. So the interpreter would need to act like a transactional database, which is not trivial. This would also slow normal execution, so it would have to be optional.

question and keep going, rather than having to stop the entire program,
fix the line, and then run again and potentially kill a bunch of time
getting the program back into the same "state."

If would definitely be nice. Perhaps $500,000 in funding would do the trick.

Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to