summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-10-28 21:22:14 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-10-28 21:59:30 -0700
commit5a72d597d63bb674291c738afe00d11ae93eff4b (patch)
tree2685fddfb04b11b5680f43457ce985fa8cee5b1c /op.c
parent43e4250a611bbded7aab070226e8d756638cd569 (diff)
downloadperl-5a72d597d63bb674291c738afe00d11ae93eff4b.tar.gz
Don’t record cop address for unbreakable lines
The cop (control op) address for each statement is recorded in ${"_<$file"}[$line] so that breakpoints set on that line will flag the op for that statement. Then, at run time, pp_dbstate checks to see whether the op is flagged as having a breakpoint, and calls the debugger if so. Statements that are not breakable are nextstate, rather than dbstate ops, and pp_nextstate ignores the flag on the op. In some instances, the cop address was being recorded for nextstate ops. This would happen in preamble code (e.g., the PERL5DB envi- ronment variable or the -M switch) and when $^P contained 0x400 but not 0x02. Recording the cop address for a nextstate op serves no purpose and is a waste of CPU cycles.
Diffstat (limited to 'op.c')
-rw-r--r--op.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/op.c b/op.c
index 7a35797cb1..9d11124c33 100644
--- a/op.c
+++ b/op.c
@@ -5930,7 +5930,7 @@ Perl_newSTATEOP(pTHX_ I32 flags, char *label, OP *o)
#endif
CopSTASH_set(cop, PL_curstash);
- if ((PERLDB_LINE || PERLDB_SAVESRC) && PL_curstash != PL_debstash) {
+ if (cop->op_type == OP_DBSTATE) {
/* this line can have a breakpoint - store the cop in IV */
AV *av = CopFILEAVx(PL_curcop);
if (av) {