NAME
Od - Idea of a Perl Compiler dump and debug
SYNOPSIS
perl -MOd=[-d=dump,]Backend[,OPTIONS] foo.pl
perl -d -MOd=Backend[,OPTIONS] foo.dump
DESCRIPTION
This module should be used as debugging replacement to O, the Perl Compiler frontend.
Debugging is done in two steps, first you store a optree dump in the CHECK
stage into foo.dump, or the dumpfile specified with the -d=dump
option, and the Compiler backend is never called.
Then you load the dump into the INIT
stage and continue.
perl -d -MOd=Backend[,OPTIONS] foo.dump
Loads the stored optree after the CHECK stage, sets up the PL_main_root
to point to the loaded optree dump and starts the debugger as specified via -d
.
PROBLEMS
But than the nasty head of Storable and B appeared. B::OP
s are a tree of linked pointers. So we need a walkoptree which stores all visited OPs into the Storable stream.
But then what to do in the 2nd thaw stage? B objects cannot be written to! All pointers are read-only. Storable hooks? Will fail on thaw
. Looks like we need a B::OP::thaw
method which re-creates blessed OPs and SVs with all its fields. Similar to Bytecode.
Setting up a dummy B package just for debugging makes no sense, as I want to debug the compiler which runs through a real B optree.
Oh my, so I gave up on this for this year.
AUTHOR
Reini Urban, rurban@cpan.org
2009