[Pharo-project] Breakpoints (was [OT] Great job guys)

Igor Stasenko siguctua at gmail.com
Fri Jan 9 05:56:26 EST 2009


2009/1/9 Janko Mivšek <janko.mivsek at eranova.si>:
> Dale Henrichs wrote:
>> ----- "Janko Mivšek" <janko.mivsek at eranova.si> wrote:
>>
>> | And when you are already doing that, introduce also breakpoints back in
>> | Pharo as they are on GLASS GemTools. Very intuitive and the same as on
>> | most other Smalltalks. If they can be supported in GemTools, why
>> | aren't yet in Pharo? Any technical reason?
>>
>> Breakpoints in GLASS/GemTools are taking advantage of the breakpoint feature in the GemStone/S VM. Remember, Squeak/Pharo are used as an OmniBrowser client for GLASS -- the debugger is running in a GemStone vm and the UI is running in the Squeak/Pharo vm.
>
> What I like about breakpoints in GemTools is the simplicity from
> usability standpoint. And similarity of use to other Smalltaltalks.
>
> And because their UI part is implemented in OmniBrowser on GemTools,
> they should be easily ported back to Pharo OmniBrowser, even that
> breakpoints in GS/S are implemented differently than in Squeak.
>
> In other words, let we port the UI for breakpoints first, on top of
> whatever Squeak supports for breakpoints currently. Later breakpoints
> can be enhanced on VM level as well.
>
There is no need in any enhancement from VM side.

Here attached the scratch implementation of breakpoints for squeak,
took about 15 minutes to implement.

Usage:

BreakPointAgent class:<yourclass> selector: <yourselector>   "will
install a breakpoint on that method"

BreakPointAgent removeAll "remove all breaks from system"

BreakPointTestClass test  " a simple test " :)

now you can subclass it and create a conditional breakpoints, which
will halt only if some criteria met.
It is trivial to add new ivar (criteriaBlock) and change
run: aSelector with: arguments in: aReceiver
to halt only if criteriaBlock evaluates to true.
There is No limits to fantasy :)

To not hide the actual method (when browsing) BreakPointAgent could be
extended to act as a proxy while it active e.g. simply redirect
messages like #literals and so on to compiled method it replaced.

> Janko
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


-- 
Best regards,
Igor Stasenko AKA sig.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BreakPointAgent.st
Type: application/octet-stream
Size: 3378 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20090109/1e9525aa/attachment.st>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BreakPointTestClass.st
Type: application/octet-stream
Size: 871 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20090109/1e9525aa/attachment-0001.st>


More information about the Pharo-dev mailing list