summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorTim Bunce <Tim.Bunce@pobox.com>2008-11-03 16:01:31 +0000
committerNicholas Clark <nick@ccl4.org>2008-11-04 08:28:29 +0000
commit2d2a15363346b8095658197c866218a0ef8f09f2 (patch)
tree91b20da5c560d80413fd0916fe96f6213001b9d1 /toke.c
parent8df137f6bc39a4f7e17e32eb0bc5f1146d535227 (diff)
downloadperl-2d2a15363346b8095658197c866218a0ef8f09f2.tar.gz
Integrate:
[ 34693] Add a flag PERLDBf_SAVESRC, which enables the saved lines part of PERLDBf_LINE, so that profilers (such as NYTProf) have access to the lines of the eval, without the speed impact of other parts of the debugger infrastructure. PERLDBf_LINE is unchanged. Based largely on a patch by Tim Bunce in <20081028152749.GA12500@timac.local> [ 34705] Subject: Re: @{"_<$filename"} is unreasonably tied to use of DB::DB ($^P & 0x2) Message-ID: <20081103160130.GA45762@timac.local> Date: Mon, 3 Nov 2008 16:01:31 +0000 [ 34706] Subject: Re: @{"_<$filename"} is unreasonably tied to use of DB::DB ($^P & 0x2) From: Tim Bunce <Tim.Bunce@pobox.com> Message-ID: <20081103162537.GB45762@timac.local> Date: Mon, 3 Nov 2008 16:25:37 +0000 p4raw-link: @34706 on //depot/perl: 4c85b59c156c7ad7ba08eb430618e674134ced22 p4raw-link: @34705 on //depot/perl: 65269a95bf2e18461f4efd8a5e0ad5bb7d043a5e p4raw-link: @34693 on //depot/perl: b8fcbefe6253f6cbcf6817158c0e99c8018b2d46 p4raw-id: //depot/maint-5.10/perl@34715 p4raw-integrated: from //depot/perl@34713 'copy in' pod/perlvar.pod (@32904..) lib/perl5db.pl (@34312..) 'merge in' perl.h (@34630..) op.c toke.c (@34698..) p4raw-integrated: from //depot/perl@34705 'merge in' gv.c (@34698..) p4raw-integrated: from //depot/perl@34693 'merge in' pp_ctl.c (@34679..)
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/toke.c b/toke.c
index cdc74aeabe..d4eb4aad90 100644
--- a/toke.c
+++ b/toke.c
@@ -1149,7 +1149,7 @@ S_skipspace(pTHX_ register char *s)
/* debugger active and we're not compiling the debugger code,
* so store the line into the debugger's array of lines
*/
- if (PERLDB_LINE && PL_curstash != PL_debstash)
+ if ((PERLDB_LINE || PERLDB_SAVESRC) && PL_curstash != PL_debstash)
update_debugger_info(NULL, PL_bufptr, PL_bufend - PL_bufptr);
}
@@ -3657,7 +3657,7 @@ Perl_yylex(pTHX)
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
PL_last_lop = PL_last_uni = NULL;
- if (PERLDB_LINE && PL_curstash != PL_debstash)
+ if ((PERLDB_LINE || PERLDB_SAVESRC) && PL_curstash != PL_debstash)
update_debugger_info(PL_linestr, NULL, 0);
goto retry;
}
@@ -3750,7 +3750,7 @@ Perl_yylex(pTHX)
incline(s);
} while (PL_doextract);
PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = s;
- if (PERLDB_LINE && PL_curstash != PL_debstash)
+ if ((PERLDB_LINE || PERLDB_SAVESRC) && PL_curstash != PL_debstash)
update_debugger_info(PL_linestr, NULL, 0);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
PL_last_lop = PL_last_uni = NULL;
@@ -3923,7 +3923,7 @@ Perl_yylex(pTHX)
} while (argc && argv[0][0] == '-' && argv[0][1]);
init_argv_symbols(argc,argv);
}
- if ((PERLDB_LINE && !oldpdb) ||
+ if (((PERLDB_LINE || PERLDB_SAVESRC) && !oldpdb) ||
((PL_minus_n || PL_minus_p) && !(oldn || oldp)))
/* if we have already added "LINE: while (<>) {",
we must not do it again */
@@ -3933,7 +3933,7 @@ Perl_yylex(pTHX)
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
PL_last_lop = PL_last_uni = NULL;
PL_preambled = FALSE;
- if (PERLDB_LINE)
+ if (PERLDB_LINE || PERLDB_SAVESRC)
(void)gv_fetchfile(PL_origfilename);
goto retry;
}
@@ -11313,7 +11313,7 @@ S_scan_heredoc(pTHX_ register char *s)
else if (PL_bufend - PL_linestart == 1 && PL_bufend[-1] == '\r')
PL_bufend[-1] = '\n';
#endif
- if (PERLDB_LINE && PL_curstash != PL_debstash)
+ if ((PERLDB_LINE || PERLDB_SAVESRC) && PL_curstash != PL_debstash)
update_debugger_info(PL_linestr, NULL, 0);
if (*s == term && memEQ(s,PL_tokenbuf,len)) {
STRLEN off = PL_bufend - 1 - SvPVX_const(PL_linestr);
@@ -11809,7 +11809,7 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims)
CopLINE_inc(PL_curcop);
/* update debugger info */
- if (PERLDB_LINE && PL_curstash != PL_debstash)
+ if ((PERLDB_LINE || PERLDB_SAVESRC) && PL_curstash != PL_debstash)
update_debugger_info(PL_linestr, NULL, 0);
/* having changed the buffer, we must update PL_bufend */