The document doesn't mention how to debug redis functions. It just mention how to debug old lua script

Comment From: itamarhaber

Hello @zillionare

You are correct - there are no docs as the inline stepping debugger wasn't implemented for functions. The plan, IIRC, was to encourage the community to contribute engine-specific client libraries that can be used for testing/development.

I'll move this discussion to the project's core repo with your permission for tracking.

Comment From: itamarhaber

/cc @MeirShpilraien

Comment From: zillionare

Hello @zillionare

You are correct - there are no docs as the inline stepping debugger wasn't implemented for functions. The plan, IIRC, was to encourage the community to contribute engine-specific client libraries that can be used for testing/development.

I'll move this discussion to the project's core repo with your permission for tracking.

sure, please track this issue.

for others may experience same issue, this is how I do the debugging, basically turn the script into an old lua eval script by changeing:

  1. uncomment #! lua name=...
  2. uncomment 'redis.register(...)'
  3. change your functions's signature from local function foo(keys, args) to local function foo(arg1, arg2, ..)`
  4. add the call to foo in the script, for example foo(param1, param2)

then you can debug the script with

redis-cli --ldb --eval /path/to/script.lua