Debugger now available in all worlds

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Debugger now available in all worlds

Christopher Schuster
Hi,

There is still a long way to go, but everyone interested in debugging Lively
can now use the built-in cross-browser debugger in three different ways:

1. Ctrl+Shift+D / Cmd+Shift+D
   keyboard shortcut to debug the selected code fragment

2. World Menu > Debugging > Debug Morphic Scripts
   enables setting breakpoints in the object editor
   with "debugger" statements

3. World Menu -> Debugging -> Prepare system for tracing/debugging +
   World Menu -> Debugging -> Start global debugging
   uses method instrumentation to maintain stack information
   with a slight performance overhead

If any of these three methods is used, unhandled exceptions will open a
debugger window instead of showing a red box.

Any feedback regarding bugs and feature requests is appreciated.

Happy debugging,
Christopher

PS: Integration with the test runner is on the way and coming soon.
_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
Reply | Threaded
Open this post in threaded view
|

Re: Debugger now available in all worlds

Robert Krahn-3
Coooool!

On Feb 13, 2012, at 1:38 AM, Christopher Schuster wrote:

> Hi,
>
> There is still a long way to go, but everyone interested in debugging Lively
> can now use the built-in cross-browser debugger in three different ways:
>
> 1. Ctrl+Shift+D / Cmd+Shift+D
>   keyboard shortcut to debug the selected code fragment
>
> 2. World Menu > Debugging > Debug Morphic Scripts
>   enables setting breakpoints in the object editor
>   with "debugger" statements
>
> 3. World Menu -> Debugging -> Prepare system for tracing/debugging +
>   World Menu -> Debugging -> Start global debugging
>   uses method instrumentation to maintain stack information
>   with a slight performance overhead
>
> If any of these three methods is used, unhandled exceptions will open a
> debugger window instead of showing a red box.
>
> Any feedback regarding bugs and feature requests is appreciated.
>
> Happy debugging,
> Christopher
>
> PS: Integration with the test runner is on the way and coming soon.
> _______________________________________________
> lively-kernel mailing list
> [hidden email]
> http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel

_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
Reply | Threaded
Open this post in threaded view
|

Re: Debugger now available in all worlds

milan zimmermann
In reply to this post by Christopher Schuster
Christopher:

This is great. I played with debugging in the Workspace and it worked great.

Inside an Object Editor I think there is something that is not quite
right: I created an Rectangle that should make an Ellipse inside it's
script:

// changed at Sun Feb 12 2012 22:31:23 GMT-0600 (CST) by undefined
this.addScript(function makeEllipses(event) {
    alert('should debug')
    debugger
    var bounds = new Rectangle(0,0,200,100)
    var morph = new lively.morphic.Morph(new
lively.morphic.Shapes.Ellipse(bounds));
    morph.setFill(Color.yellow)
    morph.openInWorld();
    }).tag([]);

If I comment out the  debugger statement, an ellipse is made. With the
debugger, if I click "Run" on the script, go to the debugger step by
step, after

var morph = new lively.morphic.Morph(new lively.morphic.Shapes.Ellipse(bounds));

the morph var is undefined.

It can be checked here:

http://lively-kernel.org/repository/webwerkstatt/users/mzimmerm/Tests/test-lively-debugger.xhtml

Thanks for giving us a way to debug!

milan


On Sun, Feb 12, 2012 at 6:38 PM, Christopher Schuster
<[hidden email]> wrote:

> Hi,
>
> There is still a long way to go, but everyone interested in debugging Lively
> can now use the built-in cross-browser debugger in three different ways:
>
> 1. Ctrl+Shift+D / Cmd+Shift+D
>   keyboard shortcut to debug the selected code fragment
>
> 2. World Menu > Debugging > Debug Morphic Scripts
>   enables setting breakpoints in the object editor
>   with "debugger" statements
>
> 3. World Menu -> Debugging -> Prepare system for tracing/debugging +
>   World Menu -> Debugging -> Start global debugging
>   uses method instrumentation to maintain stack information
>   with a slight performance overhead
>
> If any of these three methods is used, unhandled exceptions will open a
> debugger window instead of showing a red box.
>
> Any feedback regarding bugs and feature requests is appreciated.
>
> Happy debugging,
> Christopher
>
> PS: Integration with the test runner is on the way and coming soon.
> _______________________________________________
> lively-kernel mailing list
> [hidden email]
> http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
Reply | Threaded
Open this post in threaded view
|

Re: Debugger now available in all worlds

milan zimmermann
sorry I keep replying to myself. There is something else going on,
maybe my debug test page is bad somehow ...  after I reloaded the page
- In the context of the OE it seems sometimes debugger does not come
up.

So perhaps the simpler test is this: I pasted in the Workspace :

// Just Ctrl-D on the code BELOW will make Ellipse
// Shift-Ctrl-D will show debugger, step by step will make the morph
undefined at line 3
var bounds = new Rectangle(0,0,200,100)
var morph = new lively.morphic.Morph(new lively.morphic.Shapes.Ellipse(bounds))
morph.setFill(Color.yellow)
morph.openInWorld();

and the above seems to duplicate it - it is also here:

http://lively-kernel.org/repository/webwerkstatt/users/mzimmerm/debug-fails.xhtml

Thanks
milan

On Sun, Feb 12, 2012 at 10:42 PM, Milan Zimmermann
<[hidden email]> wrote:

> Christopher:
>
> This is great. I played with debugging in the Workspace and it worked great.
>
> Inside an Object Editor I think there is something that is not quite
> right: I created an Rectangle that should make an Ellipse inside it's
> script:
>
> // changed at Sun Feb 12 2012 22:31:23 GMT-0600 (CST) by undefined
> this.addScript(function makeEllipses(event) {
>    alert('should debug')
>    debugger
>    var bounds = new Rectangle(0,0,200,100)
>    var morph = new lively.morphic.Morph(new
> lively.morphic.Shapes.Ellipse(bounds));
>    morph.setFill(Color.yellow)
>    morph.openInWorld();
>    }).tag([]);
>
> If I comment out the  debugger statement, an ellipse is made. With the
> debugger, if I click "Run" on the script, go to the debugger step by
> step, after
>
> var morph = new lively.morphic.Morph(new lively.morphic.Shapes.Ellipse(bounds));
>
> the morph var is undefined.
>
> It can be checked here:
>
> http://lively-kernel.org/repository/webwerkstatt/users/mzimmerm/Tests/test-lively-debugger.xhtml
>
> Thanks for giving us a way to debug!
>
> milan
>
>
> On Sun, Feb 12, 2012 at 6:38 PM, Christopher Schuster
> <[hidden email]> wrote:
>> Hi,
>>
>> There is still a long way to go, but everyone interested in debugging Lively
>> can now use the built-in cross-browser debugger in three different ways:
>>
>> 1. Ctrl+Shift+D / Cmd+Shift+D
>>   keyboard shortcut to debug the selected code fragment
>>
>> 2. World Menu > Debugging > Debug Morphic Scripts
>>   enables setting breakpoints in the object editor
>>   with "debugger" statements
>>
>> 3. World Menu -> Debugging -> Prepare system for tracing/debugging +
>>   World Menu -> Debugging -> Start global debugging
>>   uses method instrumentation to maintain stack information
>>   with a slight performance overhead
>>
>> If any of these three methods is used, unhandled exceptions will open a
>> debugger window instead of showing a red box.
>>
>> Any feedback regarding bugs and feature requests is appreciated.
>>
>> Happy debugging,
>> Christopher
>>
>> PS: Integration with the test runner is on the way and coming soon.
>> _______________________________________________
>> lively-kernel mailing list
>> [hidden email]
>> http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
Reply | Threaded
Open this post in threaded view
|

Re: Debugger now available in all worlds

Roeder, Marko
> I pasted in the Workspace :
>
> // Just Ctrl-D on the code BELOW will make Ellipse
> // Shift-Ctrl-D will show debugger, step by step will make the morph
> undefined at line 3
> var bounds = new Rectangle(0,0,200,100)
> var morph = new lively.morphic.Morph(new lively.morphic.Shapes.Ellipse(bounds))
> morph.setFill(Color.yellow)
> morph.openInWorld();

... if you separate the shape creation it does work:

var new lively.morphic.Shapes.Ellipse(bounds)
var morph = new lively.morphic.Morph(shape)

Just a quick work around and maybe it helps debugging the debugger... ;-)

        - Marko
_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Debugger now available in all worlds

Christopher Schuster
In reply to this post by milan zimmermann
Hi,

> after I reloaded the page - In the context of the OE it seems sometimes
> debugger does not come up.

Setting breakpoints in the OE can be done by enabling "Debug Morphic Scripts"
in the world menu. Unfortunately, this setting is lost after reloading the
page and has to be enabled again. This also means you need to save the script
in the OE again after reloading the page.

> // Just Ctrl-D on the code BELOW will make Ellipse
> // Shift-Ctrl-D will show debugger, step by step will make the morph
> undefined at line 3
> var bounds = new Rectangle(0,0,200,100)
> var morph = new lively.morphic.Morph(new
lively.morphic.Shapes.Ellipse(bounds))
> morph.setFill(Color.yellow)
> morph.openInWorld();

Thank you for reporting this bug. It was caused by nested "new" expressions
and is fixed now.

Bye,
Christopher
_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
Reply | Threaded
Open this post in threaded view
|

Re: Debugger now available in all worlds

Christopher Schuster
In reply to this post by Christopher Schuster
> PS: Integration with the test runner is on the way and coming soon.

There is now a special test runner with debugging support in the PartsBin,
under "Tools". It still needs some testing but it might replace the system
test runner at some point in the future.

Best,
Christopher
_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
Reply | Threaded
Open this post in threaded view
|

Re: Debugger now available in all worlds

milan zimmermann
In reply to this post by Christopher Schuster
Christopher:

Thanks for the fix (indeed it works now) and explanation how debugging
is enabled,

Later,
Milan

On Mon, Feb 13, 2012 at 10:46 AM, Christopher Schuster
<[hidden email]> wrote:

> Hi,
>
>> after I reloaded the page - In the context of the OE it seems sometimes
>> debugger does not come up.
>
> Setting breakpoints in the OE can be done by enabling "Debug Morphic Scripts"
> in the world menu. Unfortunately, this setting is lost after reloading the
> page and has to be enabled again. This also means you need to save the script
> in the OE again after reloading the page.
>
>> // Just Ctrl-D on the code BELOW will make Ellipse
>> // Shift-Ctrl-D will show debugger, step by step will make the morph
>> undefined at line 3
>> var bounds = new Rectangle(0,0,200,100)
>> var morph = new lively.morphic.Morph(new
> lively.morphic.Shapes.Ellipse(bounds))
>> morph.setFill(Color.yellow)
>> morph.openInWorld();
>
> Thank you for reporting this bug. It was caused by nested "new" expressions
> and is fixed now.
>
> Bye,
> Christopher
> _______________________________________________
> lively-kernel mailing list
> [hidden email]
> http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
_______________________________________________
lively-kernel mailing list
[hidden email]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel