Do any debuggers support "edit and continue?"
Joel Koltner
zapwireDASHgroups at yahoo.com
Wed May 12 14:54:30 EDT 2010
"Terry Reedy" <tjreedy at udel.edu> wrote in message
news:mailman.119.1273690025.32709.python-list at python.org...
> 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.
I believe this is what, e.g., Visual Studio does with, e.g., C++ code -- it
compiles the modified code and then patches the binary to call the new code as
a subroutine or somesuch.
> 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.
Yeah, I can see this being challenging. I think it's pretty cool how some
Python debuggers will allow you to use a shell with the context set to the
current function or any of the calling functions higher up the call stack
hierarchy as well.
> This would also slow normal execution, so it would have to be optional.
That'd be a small price to pay. :-) (Visual Studio only lets you do this with
unoptimized code...)
> If would definitely be nice. Perhaps $500,000 in funding would do the trick.
Cool, if I win the lottery and add it to the "worty causes" list! :-)
Thanks for the information,
---Joel
More information about the Python-list
mailing list