Debug script already running

Hello,

is it possible to debug a script that is already running "on-demand"?

Somehow a command like "set -x" but once you've executed the script. And another one to disable debugging?

Thank you