[wingide-users] Feature request - Change text color of stack data changed since last debug state

Russell Warren rwarren at picarro.com
Mon Oct 3 17:53:50 EDT 2005


This is a very handy feature in other debuggers and it would be great to get this added to Wing.

In case the subject is not clear enough, please take the following example:

Imagine you are debugging some application, it is stopped at a breakpoint and you are looking at the state of various variables in the Stack Data tab.  Then you set a new breakpoint several lines down in the code and resume the code.  Any changes to any of the variable values that happened during the execution should appear in red in the stack data.  Also, since this is Python, new variables added to the dictionary should be coloured (maybe with a different color?).

Seems that this should be pretty easy (says the guy not coding it)?  The worst brute forcing would just require maintaining a duplicate copy of the stack data to compare against with every execution step.  Maybe have it togglable to appease the memory conscious.

Cheers,
Russ


-----Original Message-----
From: wingide-users-bounces at wingware.com
[mailto:wingide-users-bounces at wingware.com]On Behalf Of Wingware Support
Sent: Thursday, September 22, 2005 10:55 AM
To: Markus Meyer
Cc: wingide-users at wingware.com
Subject: Re: [wingide-users] Edit-and-continue, what are the
alternatives?


On Thu, 22 Sep 2005, Markus Meyer wrote:
> 1. From Visual C++, I know the Edit-and-Continue functionality. It 
> basically lets one fix the code while the app is running. Of course, 
> this doesn't work for large-scale changes, but a typo, or a wrong 
> condition in a for-loop can easily be fixed. Is it possible to do 
> something like this with Wing IDE, maybe by using the Debug console? If 
> not, is this planned?

We plan to look into adding this, and I think it's probably possible 
within certain limits.  Basically, we would have to recompile the 
appropriate code object(s) and replace (or mutate) them on the fly.

It's not something you could do manually by typing in the Debug Probe, 
although that's a good place to try out new code before you kill the 
debug process.  You can try stuff in the actual run environment and of 
course you can inspect the environment or APIS either with the other 
debugger tools or manually with dir() and so forth.

> 2. What do other users recommend in such a situation? I know that 
> writing unit tests for everything can lower the amount of debugging 
> needed for the full app, but then again, with the distributed 
> environment I have here, writing a "small" testcase for everything is 
> hardly possible.

Certainly, as the other poster suggested, breaking code down to be 
unit testable (even if you don't write all the tests right away) can 
help.

One sort of crazy idea is to restructure your code so you can have it 
reload code modules on the fly.  I've really enjoyed debugging Wing 
scripts because they do this so I have a very quick edit/test 
turn-around.  I've even worked on some internals this way and just 
moved the code elsewhere when done.  However, there's a non-trivial 
amount of machinery underneath that detects changes, reloads modules, 
and makes sure that the whole thing is designed to avoid use of old 
code objects, data, etc.

Also, if you're issuing manual SQL commands to restore the database,
I'd say try to write a Python script that does that for you.  Then if 
you're doing a lot of other manual actions, you could tie those 
together with a custom script for Wing that runs your house keeping 
scripts and then starts/restarts debugging.  Scripting Wing is 
described here:

http://wingware.com/doc/scripting/index

Well, I hope that helps.  In my experience, it definately is worth
taking steps for a short edit/test cycle -- the effort pays for itself 
quickly.

Stephan Deibel

--
Wingware
Wing IDE for Python
Advancing Software Development

www.wingware.com
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide



More information about the wingide-users mailing list