Debugger API Custom DSL Language

Hi,

I am currently trying to write a plugin which will allow for breakpoints in a DSL, which is expressed in XML.
I have registered an implementation of xdebugger.breakpointType, which allows to be place breakpoints within my file


Does anyone happen to know the current method of triggering/advancing these breakpoints when running in a java debugger, which has no correlation to bytecode?

For instance pausing/resuming/adding/removing breakpoints should actually interact with an exposed JMX service from the camel framework


I have investigated this, and I believe that the PositionManager Api cannot be used, as it correlates to Bytecode?
If possible I would like to hook into the existing Java debugger for a better user experience, so if there's a way to achieve this without creating a new program runner implementation that would be great :)



Cheers,
Alan

4 comments
Comment actions Permalink

I am currently looking at the DebuggerManagerEx class; I believe I can hook into DebuggerManagerEx.getInstance(project).addBreakPointManagerListener#breakpointsChanged() events to listen to added/removed events. However, these events don't trigger for the XML DSL, only Java breakpoints trigger.

For instance adding/removing the following breakpoints in XML will not trigger the event successfully

DebugCamel

After some research I believe this is because I need to provide an XBreakpointHandler implementation, provided via XDebugProcess#getBreakpointHandlers()?
But to achieve this I need to provide my own programRunner implementation, which I shouldn't be doing if I wish to use the existing java runner I believe?

I have now also spotted XDebuggerManager, and i'm unsure of the API differences; Which would be the preferred API to use for this scenario?

Any advice is appreciated!



Attachment(s):
DebugCamel.png
0
Comment actions Permalink

Unfortunately after much forum searching and plugin searching i am not much further on with this issue.
Does anyone happen to know the relevent APIs for providing additional debugging within a Java debug configuration from an XML file?

0
Comment actions Permalink

As far as I know there is no way to accomplish this in the current version. If your application runs under the Java debugger, all breakpoints need to be Java bytecode breakpoints. The XDebugger framework allows you to provide your own debugger implementation, but it's not possible to run a single application under the standard Java debugger and a custom debugger at the same time.

0
Comment actions Permalink

We are going to make JVM breakpoints to implement XBreakpoint interface. This will allow having one abstract breakpoint position, that could be interpreted by various debugger implementations (java, javascript, python, etc).
But if we are talning about java debugger implementation, every breakpoint that has a prototype in bytecode, should be handled via PositionManager API. PositionManager implementation translates locations in bytecode into positions in your source files. These could be positions in XML files as well, if you manage to find corresponding bytecode locations for them.
If those breakpoints are not connected to bytecode in any way, you can use XBreakpoint API to create/manage/store breakpoint positions, but provide your custom interpretations of these positions by some other means: for example utilising dedicated debug API from the vendor of the technology you are supporting.

0

Please sign in to leave a comment.