I’ve been working on making LuceeDebug really rock with Lucee 7.1
Having a step debugger really rocks, but I rarely use it myself because as it stands, it has some drawbacks
- needs agent configuration
- rewrites bytecode, lucee runs 50% slower when enabled
- rewritten bytecode has side effects like stack frame overflows
So I decided to dive in and see what could be improved, performance problems with Lucee being my favourite problem…
After some investigation and code review, I had a lightbulb moment, actually Lucee already had half the instrumentation in place via ExecutionLog needed for stepping etc
With that in mind, I deep dived into this, realising that by hijacking this and then adding some additional hooks in Lucee, statically flagged by an ENV var (so zero overhead for PROD when not used), I could achieve the holy grail of Lucee step debugging with almost zero overhead.
Now when enabled without any breakpoints, there is barely any runtime overhead if you don’t have breakpoints set, plus when breakpoints are set, I did some neat performance tricks, like checking the breakpoint line number before the filename (plus other ticks) as the breakpoint polling happens on every block of cfml when enabled.
After I got that all working (which took a while) I decided to look into what else the Debug Adapter Protocol supports
I have also added the following features
- Streaming console output to the VS Code Debug Console (i.e.
SystemOutput() - Proper break on Uncaught Exceptions (including exposing the
cfcatchscope) - Added a new
breakpoint(label, condition)BIF to programmatically trigger a breakpoint in the IDE when connected - Better request timeout handling, previously with LuceeDebug it just disabled it, now when paused, only the paused thread get temporarily request timeout disabled, stashing the remaining time and restoring after you unpause it
No longer using JWDP which polls, it now uses an event driven approach.
In addition, LuceeDebug now becomes a good old Lucee Extension, no more messing around with java properties, just install the extension and enable via an ENV var
https://luceeserver.atlassian.net/browse/LDEV-1402
Still a WIP and unreleased (still just a proposed PR), Lucee 7.1 is going to fucking rock!


