Inserting halts using pragmas?

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

Inserting halts using pragmas?

Fernando olivero
Hi,  can we inserts halt's into methods without modifying source code, using pragmas maybe?

Has there been work on this?

Thanks,
Fernando
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Inserting halts using pragmas?

Lukas Renggli
> Hi,  can we inserts halt's into methods without modifying source code, using pragmas maybe?

This has nothing to do with pragmas. Pragmas do not change execution
behavior of a compiled method. Also pragmas are in the source code, so
you cannot add them without changing the source.

There was some work on annotations by Marcus, this goes more into the
direction you are looking for.

What I would do is to replace a compiled method with a custom object
that implements #run:with:in: and that opens a debugger at the right
place.

Lukas

--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Inserting halts using pragmas?

Peter Hugosson-Miller


On Mon, Apr 12, 2010 at 11:11 AM, Lukas Renggli <[hidden email]> wrote:
> Hi,  can we inserts halt's into methods without modifying source code, using pragmas maybe?

This has nothing to do with pragmas. Pragmas do not change execution
behavior of a compiled method. Also pragmas are in the source code, so
you cannot add them without changing the source.

There was some work on annotations by Marcus, this goes more into the
direction you are looking for.

What I would do is to replace a compiled method with a custom object
that implements #run:with:in: and that opens a debugger at the right
place.

Yes, that's more or less how VisualAge does it. See DbgBreakpointedMethod, a variable Subclass of CompiledMethod.

-- 
Cheers,
Peter
 
Lukas

--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Inserting halts using pragmas?

Stéphane Ducasse
In reply to this post by Fernando olivero
There was a break on enter code somewhere.
Does anybody remember?

I remember some code of igor to do that.
Would be good to resurrect that.

Stef

On Apr 12, 2010, at 10:27 AM, Fernando olivero wrote:

> Hi,  can we inserts halt's into methods without modifying source code, using pragmas maybe?
>
> Has there been work on this?
>
> Thanks,
> Fernando
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Inserting halts using pragmas?

Fernando olivero
In reply to this post by Lukas Renggli
I see, thanks Lukas for the info.

My wish for the new editor i'm developing is to able to insert halts, into the code just as any other IDE.
By selecting the statement  and indicating by some means to insert a halt ( called breakpoint in non-proccess reified languages).

Would be nice to get that code, if not i'll implement my own debugging wrapper.

Fernando

On Apr 12, 2010, at 11:11 AM, Lukas Renggli wrote:

>> Hi,  can we inserts halt's into methods without modifying source code, using pragmas maybe?
>
> This has nothing to do with pragmas. Pragmas do not change execution
> behavior of a compiled method. Also pragmas are in the source code, so
> you cannot add them without changing the source.
>
> There was some work on annotations by Marcus, this goes more into the
> direction you are looking for.
>
> What I would do is to replace a compiled method with a custom object
> that implements #run:with:in: and that opens a debugger at the right
> place.
>
> Lukas
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Inserting halts using pragmas?

Marcus Denker-4
In reply to this post by Stéphane Ducasse

On Apr 12, 2010, at 1:30 PM, Stéphane Ducasse wrote:

> There was a break on enter code somewhere.
> Does anybody remember?
>
Yes, but this is *very* simplistic: it just recompiled the method with a self halt at the
beginning. (silently, so it does not end up in the log/changeset/MC).

I nearly removed it as it's not really used....

        Marcus


--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Inserting halts using pragmas?

Igor Stasenko
In reply to this post by Stéphane Ducasse
On 12 April 2010 14:30, Stéphane Ducasse <[hidden email]> wrote:
> There was a break on enter code somewhere.
> Does anybody remember?
>
> I remember some code of igor to do that.
> Would be good to resurrect that.
>
well, i still having that code somewhere.
the problem with using  #run:with:in:
that you can't put a breakpoint inside an arbitrary place in method.
You can break on entering a method (or leaving it).

But this is not the main problem. Main problem is UI. It should be
made convenient enough for use,
because if its not accessible from UI, its no matter how highly
advanced/cool implementation is, since nobody will use it anyway :)


> Stef
>
> On Apr 12, 2010, at 10:27 AM, Fernando olivero wrote:
>
>> Hi,  can we inserts halt's into methods without modifying source code, using pragmas maybe?
>>
>> Has there been work on this?
>>
>> Thanks,
>> Fernando
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Inserting halts using pragmas?

Marcus Denker-4

On Apr 12, 2010, at 2:12 PM, Igor Stasenko wrote:

> On 12 April 2010 14:30, Stéphane Ducasse <[hidden email]> wrote:
>> There was a break on enter code somewhere.
>> Does anybody remember?
>>
>> I remember some code of igor to do that.
>> Would be good to resurrect that.
>>
> well, i still having that code somewhere.
> the problem with using  #run:with:in:
> that you can't put a breakpoint inside an arbitrary place in method.
> You can break on entering a method (or leaving it).

You could just store the AST in your fake method, put the halt as an annotation, then
interpret the AST with a special interpreter that checks for the annotation.

Phillippe did a evaluation-visitor for the RB AST, and the RB AST allows for
properties to be set on any node. The code is in the Reflectivity package (part
of the Persephone "JIT"), so we would have already large parts of the needed
infrastructure.

        Marcus

--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project