[Pharo-project] feature idea - Watcher
One thing I remember from 25 years ago using Turbo Pascal is having an "Expression Watcher" pane, where expressions could be defined that were evaluated after each debugging step. With this you could drill down to a particular interesting part of a data structure to observe how it changes with time. I am reminded of this since just now, since I am finding each time I rerun a test script and the debugger opens up at my 'halt' point, I am repetitively having to 'inspect' from a root object through several levels of components to compare the components of interest - before continuing to step the code watching how these component values change in relation to each other. For example if variable1 holds an OrderedCollection of five morphs and I want to watch the 'bounds' of all five elements simultaneously as they update at each debugging step - currently each time after the debugger opens I have to inspect variable1, then Inspect each of the elements, the select the 'bounds' instance variable in each Inspector window, then shrink the size each inspector so that they don't obscure the screen, which is fairly tedious to do each time. Further, with 'bounds' matching an instance variable this is at least possible - once this is set up I can watch the 'bounds' value change with each debug step. However if I want to observe how the 'extent' of each morph changes with each debug step I am out of luck. With my current knowledge, I would need to manually execute 'self extent' in each of the five Inspectors after each debug step, It would be good if there were some way for expressions to be defined which persist through debugger invocations that at each debug step are evaluated on the instance variables available in the debugger at that time. For the example above this might be defined of the form... <'label'> <expression> <'extent1'> <(variable1 asArray at: 1) extent> <'extent2'> <(variable1 asArray at: 2) extent> <'extent3'> <(variable1 asArray at: 3) extent> <'extent4'> <(variable1 asArray at: 4) extent> <'extent5'> <(variable1 asArray at: 5) extent> Is there currently any way to do this, or would others find something like this a useful feature ? cheers -ben
On 11 September 2012 14:09, Ben Coman <btc@openinworld.com> wrote:
One thing I remember from 25 years ago using Turbo Pascal is having an "Expression Watcher" pane, where expressions could be defined that were evaluated after each debugging step. With this you could drill down to a particular interesting part of a data structure to observe how it changes with time. I am reminded of this since just now, since I am finding each time I rerun a test script and the debugger opens up at my 'halt' point, I am repetitively having to 'inspect' from a root object through several levels of components to compare the components of interest - before continuing to step the code watching how these component values change in relation to each other.
For example if variable1 holds an OrderedCollection of five morphs and I want to watch the 'bounds' of all five elements simultaneously as they update at each debugging step - currently each time after the debugger opens I have to inspect variable1, then Inspect each of the elements, the select the 'bounds' instance variable in each Inspector window, then shrink the size each inspector so that they don't obscure the screen, which is fairly tedious to do each time. Further, with 'bounds' matching an instance variable this is at least possible - once this is set up I can watch the 'bounds' value change with each debug step. However if I want to observe how the 'extent' of each morph changes with each debug step I am out of luck. With my current knowledge, I would need to manually execute 'self extent' in each of the five Inspectors after each debug step,
It would be good if there were some way for expressions to be defined which persist through debugger invocations that at each debug step are evaluated on the instance variables available in the debugger at that time. For the example above this might be defined of the form... <'label'> <expression> <'extent1'> <(variable1 asArray at: 1) extent> <'extent2'> <(variable1 asArray at: 2) extent> <'extent3'> <(variable1 asArray at: 3) extent> <'extent4'> <(variable1 asArray at: 4) extent> <'extent5'> <(variable1 asArray at: 5) extent>
Is there currently any way to do this, or would others find something like this a useful feature ?
That would be an extremely useful feature: I miss this from Turbo Pascal/Delphi days, and I too have to constantly inspect anew certain interesting things, or - if possible - refresh my Explorer on the object. Expression Watcher is more general than an Explorer because you can look at things not defined solely by an object's structure. frank
On 11 September 2012 15:09, Ben Coman <btc@openinworld.com> wrote:
One thing I remember from 25 years ago using Turbo Pascal is having an "Expression Watcher" pane, where expressions could be defined that were evaluated after each debugging step. With this you could drill down to a particular interesting part of a data structure to observe how it changes with time. I am reminded of this since just now, since I am finding each time I rerun a test script and the debugger opens up at my 'halt' point, I am repetitively having to 'inspect' from a root object through several levels of components to compare the components of interest - before continuing to step the code watching how these component values change in relation to each other.
For example if variable1 holds an OrderedCollection of five morphs and I want to watch the 'bounds' of all five elements simultaneously as they update at each debugging step - currently each time after the debugger opens I have to inspect variable1, then Inspect each of the elements, the select the 'bounds' instance variable in each Inspector window, then shrink the size each inspector so that they don't obscure the screen, which is fairly tedious to do each time. Further, with 'bounds' matching an instance variable this is at least possible - once this is set up I can watch the 'bounds' value change with each debug step. However if I want to observe how the 'extent' of each morph changes with each debug step I am out of luck. With my current knowledge, I would need to manually execute 'self extent' in each of the five Inspectors after each debug step,
It would be good if there were some way for expressions to be defined which persist through debugger invocations that at each debug step are evaluated on the instance variables available in the debugger at that time. For the example above this might be defined of the form... <'label'> <expression> <'extent1'> <(variable1 asArray at: 1) extent> <'extent2'> <(variable1 asArray at: 2) extent> <'extent3'> <(variable1 asArray at: 3) extent> <'extent4'> <(variable1 asArray at: 4) extent> <'extent5'> <(variable1 asArray at: 5) extent>
i don't think it worth spending time on implementing such complex definitions.. as to me, being able to simple re-evaluate and expression sent to some object(s) (and print its result , of course) at every debug step will be just enough.
Is there currently any way to do this, or would others find something like this a useful feature ?
cheers -ben
-- Best regards, Igor Stasenko.
participants (3)
-
Ben Coman -
Frank Shearar -
Igor Stasenko