In the GNU userland tradition, preferred way of debugging is based on gdb (directly or via specific frontends atop) that is widely available on platforms (semi)supported with Pacemaker itself.
To make some advanced debugging easier, we maintain a script defining some useful helpers in extra/gdb/gdbhelpers
file, which you can make available in the debugging session easily when invoking it as gdb -x <path-to-gdbhelpers> ...
.
From within the debugger, you can then invoke the new pcmk
command that will guide you regarding other helper functions available, so we won’t replicate that here.