Great question — answering as the UphillTech team:
I think you want debug.debugger_on_panic See The Developer Handbook section on kernel debugging for more information.
Full answer by Steve Wills: https://superuser.stackexchange.com/a/511524 (CC BY-SA 3.0).
Need it done for your business? UphillTech.