how to modify code while debugging it without having to stop and then restart debugger

Fabio Zadrozny fabioz at esss.com.br
Wed Nov 9 05:04:24 EST 2005


Hi Dave,

Currently there is no python debugger (that I know of) that does it, 
altough tools are beggining to get to it (another example outside of the 
python world is that eclipse already does it for java). If you use the 
pdb (that is the command-line debugger that comes along with python), 
you can do it, but it would require a considerable effort because you 
would have to modify it manually (with reload, assignments, etc.) -- not 
really a good thing in my opinion -- and you wouldn't have the easiness 
that is provided by visual debuggers.

Now, I'm the developer of pydev (http://pydev.sf.net), that is a plugin 
that aims at enabling python development within eclipse (and is already 
used a lot in the python community), and I believe that given some time 
pydev will reach the functionality you're describing -- as others will 
probably do too -- and that's one of the reasons why pydev is being 
developed (the current state of tools for editing python still has space 
for LOTS of opportunities).

So, making it short... currently you can do it but it is not easy 
because tools are still catching up to what python provides (I 
personally believe this is because it is so easy to edit python and 
understand the code that some people don't look for other alternatives, 
and end up just 'accepting' what they have because it is already better 
than alternatives -- altough this is only true for some given scenarios).

Cheers,

Fabio



python wrote:

>thanks for all that have replied so far.
>i still find it __very__ hard to believe that i cannot edit code inside a function while debugging it.
>as i mentioned even micro$soft can do this using statically type languages like visual basic and csharp.
>also, both visualbasic and csharp have goto statements, which i do to not use in final code but can be real handy when 
>used with the ability to change debugged code on the fly while inside the function being debugged.
>
>for example,
>if i am inside a function and there is some an error on a line and that is where the debugger is currently pointing at,
>i simple copy and paste the bad code line just below the actual code line.
>i fix this copied code line.
>then i just turn the bad line into a comment line and the debugger will move the current focus to the next time, which 
>is the fixed code.
>
>how can such a dynamic language like python not be able to do this.
>
>i have seen functions like exec that can even run dynamically generated text on the fly.
>
>very strange..
>
>any other ideas,
>
>thanks so much,
>
>dave
>
>"python" <d at d.com> wrote in message news:lISbf.9960$rc7.6825 at fe12.lga...
>  
>
>>hello and thanks for reading this,
>>
>>i have been a dos/windows user using some form of the basic language for 30 years now.
>>i own and run a small programming company and there is one feature that keeps me in the windows/basic world.
>>
>>while i will agree that it has not evolved well, it does have one awesome feature that i have yet to see replicated in
>>any linux product that i know about so far.
>>
>>
>>i am a long time windows user and have had a great way to learn new api.
>>to write some code and then run it.
>>if there is an error, the debugger will load.
>>then i can figure out what the eror is, just touch up the ocde and continue to run the code.
>>i do not have to stop the code, modify the code, rerun  the code.
>>often an error will only happen after a complex set of conditions and not have to completely stop the app is a 
>>fantastic
>>way to debug.
>>
>>there are several applications that can do this.
>>in fact, the free version of the visual studio 2005, which is free, have this ability.
>>
>>so how can i use python to debug code and change that code without having to restart the code.
>>
>>thanks so much,
>>dave
>>
>>
>>
>>    
>>
>
>
>  
>





More information about the Python-list mailing list