Change 34979 by [EMAIL PROTECTED] on 2008/12/02 14:46:17

        Add two more flags, PERLDBf_SAVESRC_NOSUBS and PERLDBf_SAVESRC_INVALID,
        which give total control over when source code from evals is stored.
        The debugger doesn't need them, but I forsee that profilers might.

Affected files ...

... //depot/perl/perl.h#845 edit
... //depot/perl/pp_ctl.c#718 edit

Differences ...

==== //depot/perl/perl.h#845 (text) ====
Index: perl/perl.h
--- perl/perl.h#844~34790~      2008-11-10 04:49:23.000000000 -0800
+++ perl/perl.h 2008-12-02 06:46:17.000000000 -0800
@@ -5346,6 +5346,8 @@
 #define PERLDBf_NAMEEVAL       0x100   /* Informative names for evals */
 #define PERLDBf_NAMEANON       0x200   /* Informative names for anon subs */
 #define PERLDBf_SAVESRC        0x400   /* Save source lines into 
@{"_<$filename"} */
+#define PERLDBf_SAVESRC_NOSUBS 0x800   /* Including evals that generate no 
subrouties */
+#define PERLDBf_SAVESRC_INVALID        0x1000  /* Save source that did not 
compile */
 
 #define PERLDB_SUB     (PL_perldb && (PL_perldb & PERLDBf_SUB))
 #define PERLDB_LINE    (PL_perldb && (PL_perldb & PERLDBf_LINE))
@@ -5359,6 +5361,8 @@
 #define PERLDB_NAMEANON        (PL_perldb && (PL_perldb & PERLDBf_NAMEANON))
 #define PERLDB_ASSERTION (PL_perldb && (PL_perldb & PERLDBf_ASSERTION))
 #define PERLDB_SAVESRC         (PL_perldb && (PL_perldb & PERLDBf_SAVESRC))
+#define PERLDB_SAVESRC_NOSUBS  (PL_perldb && (PL_perldb & 
PERLDBf_SAVESRC_NOSUBS))
+#define PERLDB_SAVESRC_INVALID (PL_perldb && (PL_perldb & 
PERLDBf_SAVESRC_INVALID))
 
 #ifdef USE_LOCALE_NUMERIC
 

==== //depot/perl/pp_ctl.c#718 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#717~34935~    2008-11-26 14:25:18.000000000 -0800
+++ perl/pp_ctl.c       2008-12-02 06:46:17.000000000 -0800
@@ -3730,9 +3730,10 @@
        save_lines(CopFILEAV(&PL_compiling), PL_parser->linestr);
     PUTBACK;
     ok = doeval(gimme, NULL, runcv, seq);
-    if ((PERLDB_LINE || PERLDB_SAVESRC)
-       && was != PL_breakable_sub_gen /* Some subs defined here. */
-       && ok) {
+    if (ok ? (was != PL_breakable_sub_gen /* Some subs defined here. */
+             ? (PERLDB_LINE || PERLDB_SAVESRC)
+             :  PERLDB_SAVESRC_NOSUBS)
+       : PERLDB_SAVESRC_INVALID) {
        /* Just need to change the string in our writable scratch buffer that
           will be used at scope exit to delete this eval's "file" name, to
           something safe. The key names are of the form "_<(eval 1)" upwards,
End of Patch.

Reply via email to