Managed to connect lua debugger in Visual Studio Code with my program.
It was a major pain in the ass so here are the steps for future reference:

0. get the debugger extension for VSC:
https://marketplace.visualstudio.com...vCAT.lua-debug

1. get lua 5.1 bindings from here:
https://blog.spreendigital.de/2009/0...r-delphi-2010/
Note that there are newer ones posted on same site for lua 5.3 but debugger works with 5.1

2. Debugger VSC extension has some other lua libs dependencies. Tried binaries from different places and wasted whole day on it. Instead install luarocks and get dkjson and luasocket with it.

3. Copy mentioned libraries, lua5.1,lua51 from luarocks to your programs' exe folder and overwrite dll that comes with delphi bindings.

4. follow steps in debugger setup instructions (launch json config, add magic script lines in your client, call debbugee.poll in lua tick function called from client on timer).

That's about it. Didn't play with it much yet but breakpoints are working, local vars can be inspected. So far so good.