If you have Python bindings for the PAM Application library then you can write test units in Python and use Pythons pdb module debug a Python PAM module. This is how pam_python was developed.
I used PyPAM
for the Python Application library bindings.
Distributions often package it as python-pam
.
To set breakpoints in pdb either wait until
PAM has loaded your module,
or import
it before you start debugging.