Annoyingly, the 'struct block_sub' context structure doesn't contain the actual current depth of this call. It does, however, contain a field called 'olddepth', which is the depth the interpreter should restore the CV to when that block returns.
In effect, this means that the depth of the innermost call is given by the CV itself, and the depth of each subsequent call going down is given by the 'olddepth' field of the call nested inside it.
Efficient from an interpreter perspective, but horrible for our analysis purposes.
The question now becomes: where should we perform this conversion? Should the .pmat file dump the raw 'olddepth' field and leave it to the loader to fix up, much as it currently fixes so much other stuff? That probably feels best, as compared trying to get the dumper to walk those references and fix them up internally.
Added problem: CVs don't store the depth either.
--
Paul Evans