The idea is to plug mvel debugger into the existing JDT-based debugger. Existing debugger is able to define breakpoints in a ".drl" file and these drl files can have java and mvel syntax code and both will become be debuggable.
I'm already able to recognize if breakpoint in .drl file is for mvel or java (and relative line numbers etc).
Current java breakpoints are JDT-based and just have some extra wrappers and source locator so it's able to navigate to correct .drl file line.
MVEL Debugger is using JDI events to communicate with the debugger client.
Process involves two steps:
1. Setting breakpoints:
Using target VM debugging capability to Change Field value at target VM
We set breakpoints remotely to reflect breakpoint rows in MVEL Debugger editor
2. While MVEL is executing it's command, it checks for these specified breakpoints and if found it changes a variable that my debugger is watching. This watching debugger request has SUSPEND policy so VM stops when you update this breakpoint-catched variable. So I can dig in and read local variables that you provide. I'm using these local variables in my debugger UI stackframe.
After asking debugger to "continue", I RESUME target VM and will set a variable so you know at your side that it's safe to continue running script. The same logic with Step Over etc actions. I'll set field values remotely to instruct your debugging infrastructure about next action.