Use B::Generate to change the nextstate ops into
dbstate ops. Here are a few links to get you started:
an article by Simon Cozen, author of B::Generate
as published on
perl.com
that shows how to rewrite programs using B::Generate.
Perl
Assembly - structure of the bytecode, common ops and
idioms.
If you want to enable debugging completely after the
fact from a module, it is possible, but it is tricky,
and because of that you might want to consider
changing your requirements - but again, it can be done.
-scott