Bashdb is a utility that is similar to gdb, in that you can do things like set breakpoints at a line or at a function, print content of variables, you can restart script execution and more.
You can normally install it via your package manager, for example on Fedora:
sudo dnf install bashdb
Or ...