Seems the debugger subtly alters the behavior of caller, so relying on its values is problematic. I have the following embarrassing code as a result:
# XXX Yuck. The debugger has buggered me. It alters the behavior of
my $is_top_predicate = $DB::I_m_init
? $calling_sub !~
: $calling_sub ne $anon_sub;
This is because if the conditional true, $calling_sub is usually t::__ANON__. Under the debugger it's more like t::__ANON__[t/ast.t:47]
I feel dirty now.