Debugging support for custom scripting language

We have implemented custom scripting language, that is parsed and interpreted from our java application. We have written a IntelliJ plugin for that language, and we would like to add debugging support. What I'm trying to achieve:

1. Insert breakpoint into a script file
2. Stop on breakpoint, support standard actions like step over, step into, step out, resume...
3. Provide locals tool window and evaluation of expressions written in our script language
4. Seamlessly integrate with existing java debugger (support debug in test as well as in remote debug of app server, mix breakpoints in java and in the script language)

Is there any example how to do this?

I tried to implement custom program runner (extending the DefaultJavaProgramRunner) and XDebugProcess, XLineBreakpointType, XBreakpointHandler etc. and now I'm able to insert breakpoint into our script file, but it does not stop execution there. What's worse, the regular java breakpoints stopped working.

We have already the debugger infrastructure for our script language, so we are able to suspend, step over, resume etc. in our script. We even have a proprietary debugger, but I would like to debug it directly from IntelliJ IDEA.

Thanks for suggestions.

2 comments
Comment actions Permalink

I found an interesting class, com.intellij.debugger.engine.JavaDebugProcess. Would it help to extend this class instead of XDebugProcess? I also noticed that it is not part of API yet and it is in master branch only. Is this class scheduled to be released in IDEA 14?

Correct me if I'm wrong, but it should be possible to:
- Extend JavaDebugProcess class
- Handle all breakpoints and debugger actions for our language
- Delegate to base class in case of java breakpoints

0
Comment actions Permalink

nope.

U need implement PositionManagerFactory, PositionManager, JavaDebugAware

0

Please sign in to leave a comment.