FM Debugger Improvement

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

FM Debugger Improvement

angelozerr
Hi Attila,

I have start to implement Freemarker DBGP debugger and I can
add/remove breakpoint and suspend the Eclipse editor to the
breakpoint. To manage that I had to restart your work about FM
Debugger. I would like explain problems with your API and see if it's
possible to change the API as I have done. You can see  my API
debugger at https://freemarker.svn.sourceforge.net/svnroot/freemarker/sandbox/org.eclipse.dltk.freemarker/freemarker.provisionnal

I'm using freemarker.provisionnal for the moment to have no conflict
with your API.

Here problems with your API :

1. Impossible to use new DebuggerService implementation

DebuggerService class create DebuggerService like this :

-----------------
private static DebuggerService createInstance()
    {
        // Creates the appropriate service class. If the debugging is turned
        // off, this is a fast no-op service, otherwise it is the real-thing
        // RMI service.
        return
            SecurityUtilities.getSystemProperty("freemarker.debug.password")
== null
            ? (DebuggerService)new NoOpDebuggerService()
            : (DebuggerService)new RmiDebuggerService();
    }
-----------------

In my case I need to have DBGpDebuggerService but it's impossible with
your API. Your DebugBreak class use static class
DebuggerService#suspendEnvironment

-----------------
public class DebugBreak extends TemplateElement
{
    public void execute(Environment env) throws TemplateException, IOException
    {
        if(!DebuggerService.suspendEnvironment(env, nestedBlock.getBeginLine()))
        {
            nestedBlock.execute(env);
        }
        else
        {
            throw new StopException(env, "Stopped by debugger");
        }
    }
-----------------


2. Static DebuggerService problem.

To manage my DBGpDebuggerService , I could hadd it to DebuggerService
#createInstance method, but problem will come from if we wish
implement another DebuggerService. More with Eclipse IDE we could
launch several Debug launch for several application and we need
several instance of DebuggerService.  The solution is to use
DebuggerService  instance and not singleton. So My DebugBreak
(https://freemarker.svn.sourceforge.net/svnroot/freemarker/sandbox/org.eclipse.dltk.freemarker/freemarker.provisionnal/src/freemarker/provisionnal/core/ast/DebugBreak.java)
use  DebuggerService instance fill to the DebugBreak constructor.

It works well but My DebuggerService is not very clean. I would like
know your idea about DebuggerService to have clean API Debugger. Is it
possible to see my code about API Debugger and tell me if you like
this API?

3. DebugBreak bug with </#if>

When you add breakpoint to end if, supsend must be done AFTER the
nestedBlock is executed. I have try to fix that by using condition :

boolean suspendAfter = (nestedBlock.getBeginLine() != breakpoint.getLine());

4. Mixed Content problem

When you have this FTL content

----------------------
aaaa
bbbb
ccc
----------------------

If you add breakpint to line 2 (bbbb), the editor is suspended to the
line 1. I don't know how fix this problem?

5.Manage Spep Into,/Over,/Return

how manage that?

Thank a lot for your help.

Regards Angelo

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: FM Debugger Improvement

angelozerr
Hi Attila,

Could you when you will have time answer to this post. I would like
step by step move my Java code from
https://freemarker.svn.sourceforge.net/svnroot/freemarker/sandbox/org.eclipse.dltk.freemarker/freemarker.provisionnal
to Freemarker trunk (I must send you my CLA before).

Thank a lot for your help+suggestions.

Regards Angelo

2010/7/19 Angelo zerr <[hidden email]>:

> Hi Attila,
>
> I have start to implement Freemarker DBGP debugger and I can
> add/remove breakpoint and suspend the Eclipse editor to the
> breakpoint. To manage that I had to restart your work about FM
> Debugger. I would like explain problems with your API and see if it's
> possible to change the API as I have done. You can see  my API
> debugger at https://freemarker.svn.sourceforge.net/svnroot/freemarker/sandbox/org.eclipse.dltk.freemarker/freemarker.provisionnal
>
> I'm using freemarker.provisionnal for the moment to have no conflict
> with your API.
>
> Here problems with your API :
>
> 1. Impossible to use new DebuggerService implementation
>
> DebuggerService class create DebuggerService like this :
>
> -----------------
> private static DebuggerService createInstance()
>    {
>        // Creates the appropriate service class. If the debugging is turned
>        // off, this is a fast no-op service, otherwise it is the real-thing
>        // RMI service.
>        return
>            SecurityUtilities.getSystemProperty("freemarker.debug.password")
> == null
>            ? (DebuggerService)new NoOpDebuggerService()
>            : (DebuggerService)new RmiDebuggerService();
>    }
> -----------------
>
> In my case I need to have DBGpDebuggerService but it's impossible with
> your API. Your DebugBreak class use static class
> DebuggerService#suspendEnvironment
>
> -----------------
> public class DebugBreak extends TemplateElement
> {
>    public void execute(Environment env) throws TemplateException, IOException
>    {
>        if(!DebuggerService.suspendEnvironment(env, nestedBlock.getBeginLine()))
>        {
>            nestedBlock.execute(env);
>        }
>        else
>        {
>            throw new StopException(env, "Stopped by debugger");
>        }
>    }
> -----------------
>
>
> 2. Static DebuggerService problem.
>
> To manage my DBGpDebuggerService , I could hadd it to DebuggerService
> #createInstance method, but problem will come from if we wish
> implement another DebuggerService. More with Eclipse IDE we could
> launch several Debug launch for several application and we need
> several instance of DebuggerService.  The solution is to use
> DebuggerService  instance and not singleton. So My DebugBreak
> (https://freemarker.svn.sourceforge.net/svnroot/freemarker/sandbox/org.eclipse.dltk.freemarker/freemarker.provisionnal/src/freemarker/provisionnal/core/ast/DebugBreak.java)
> use  DebuggerService instance fill to the DebugBreak constructor.
>
> It works well but My DebuggerService is not very clean. I would like
> know your idea about DebuggerService to have clean API Debugger. Is it
> possible to see my code about API Debugger and tell me if you like
> this API?
>
> 3. DebugBreak bug with </#if>
>
> When you add breakpoint to end if, supsend must be done AFTER the
> nestedBlock is executed. I have try to fix that by using condition :
>
> boolean suspendAfter = (nestedBlock.getBeginLine() != breakpoint.getLine());
>
> 4. Mixed Content problem
>
> When you have this FTL content
>
> ----------------------
> aaaa
> bbbb
> ccc
> ----------------------
>
> If you add breakpint to line 2 (bbbb), the editor is suspended to the
> line 1. I don't know how fix this problem?
>
> 5.Manage Spep Into,/Over,/Return
>
> how manage that?
>
> Thank a lot for your help.
>
> Regards Angelo
>

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel