It's kind of silly, but I am going to answer my own question here, in case anyone else runs into this problem, hopefully a super-search will get them to here.

Well, I finally managed to find a solution, which was to replace this line:

push @stack_trace, [ (caller($i))[0 .. 3] ] while caller(++$i);  
with these lines:
{ package DB; my $i = 0; my @c; while (@c = caller($i++)) { next if $c[3] =~ /.*?\:\:throw/; push @stack_trace, [ @c[0 .. 7] ]; } }
For whatever reason, this needed to be called through the DB package to work under Devel::Cover, but the relationship between caller and DB are well known, so that was fine. The stack trace information gathering works the same, but since Devel::Cover seems to be messing with the index of the call stack the best way to was to capture more than I usually do, and to ignore the stack frames which came from my throw routine. This now passes both make test and Devel::Cover runs.

I am still trying to figure out what the real reason behind this all is, and I am planning to examine it deeper so I can submit a bug report as well. Any thoughts, comments or suggestions are still welcome.

-stvn

In reply to Re: Devel::Cover eating caller() information by stvn
in thread Devel::Cover eating caller() information by stvn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.