rokucommunity / roku-debug

A compatibility wrapper around the BrightScript debug protocol https://developer.roku.com/en-ca/docs/developer-program/debugging/socket-based-debugger.md
MIT License
13 stars 9 forks source link

Improve hit condition debugging logic #98

Open TwitchBronBron opened 2 years ago

TwitchBronBron commented 2 years ago

Node-debug supports many different hit conditions (see this link for more info).

Currently the debug protocol only supports a single variation (when this breakpoint has been hit x times, then stop every time after). If the debug protocol won't implement all the other variations, then we could abuse the new conditional breakpoints to leverage our own hit count, by adding an expression like this. Consider the hit condition % 5

(function(): try : m.hitCount_abcdef++ : catch e : m.hitCount_abcdef= 1 : end try : return hitCount_abcdef mod 5 = 0 : end function)()
TwitchBronBron commented 2 years ago

I'm not sure why we needed to jump through all these hoops. I just re-tested, and it seems that multi-line expressions are supported natively.

image