develooper Front page | perl.perl5.porters | Postings from October 2008

@{"_<$filename"} is unreasonably tied to use of DB::DB ($^P & 0x2)

Thread Next
From:
Tim Bunce
Date:
October 28, 2008 08:28
Subject:
@{"_<$filename"} is unreasonably tied to use of DB::DB ($^P & 0x2)
Message ID:
20081028152749.GA12500@timac.local
The perldebguts pod says that @{"_<$filename"} holds the lines of
source code of $filename. That's implemented by a call in pp_ctl.c
to save_lines().

The call to save_lines() is only made if PERLDB_LINE is true ($^P & 0x2).
PERLDB_LINE is used primarily to enable single-stepping or profiling
by calling the DB::DB() for every statement.

So currently you can't introspect the source code of files (or evals,
and "perl -" or "perl -e '...'") without enabling single-stepping!

This is an issue for NYTProf because it would like to be able to save
the source code of evals etc. but would like to avoid using the slow
expensive DB::DB style of profiling.

The attached basic patch enables a separate bit to control saving source
lines.

Any chance this, or something like it, could go into 5.10.1?

Tim.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About