New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger patch - trace to max depth #11765
Comments
From @pjscottThe attached patch adds to the debugger a capability I thought about t 3 - turn tracing on, trace up to 3 levels below current depth, be Since it is backwards compatible I added it to the legacy command set as |
From @pjscottInline Patch--- lib/perl5db.pl.orig 2010-09-05 19:47:29.000000000 -0700
+++ lib/perl5db.pl 2011-11-21 01:42:49.000000000 -0800
@@ -2108,7 +2108,7 @@
"$line:\t$dbline[$line]$after" );
}
else {
- print_lineinfo($position);
+ print_lineinfo($position) if $stack_depth < $trace_to_depth;
}
# Scan forward, stopping at either the end or the next
@@ -2136,7 +2136,7 @@
"$i:\t$dbline[$i]$after" );
}
else {
- print_lineinfo($incr_pos);
+ print_lineinfo($incr_pos) if $stack_depth < $trace_to_depth;
}
} ## end for ($i = $line + 1 ; $i...
} ## end else [ if ($slave_editor)
@@ -2336,17 +2336,21 @@
exit $?;
};
-=head4 C<t> - trace
+=head4 C<t> - trace [n] - trace [to n levels below current stack depth]
Turn tracing on or off. Inverts the appropriate bit in C<$trace> (q.v.).
+If level is specified, set C<$trace_to_depth>.
=cut
- $cmd =~ /^t$/ && do {
+ $cmd =~ /^t(?:\s+(\d+))?$/ && do {
$trace ^= 1;
local $\ = '';
+ $trace_to_depth = $1 ? $stack_depth + $1 : 1E9;
print $OUT "Trace = "
- . ( ( $trace & 1 ) ? "on" : "off" ) . "\n";
+ . ( ( $trace & 1 )
+ ? ( $1 ? "on (to level $trace_to_depth)" : "on" )
+ : "off" ) . "\n";
next CMD;
};
@@ -3417,7 +3421,9 @@
=cut
# t - turn trace on.
- $cmd =~ s/^t\s/\$DB::trace |= 1;\n/;
+ $cmd =~ s/^t\s+(\d+)?/\$DB::trace |= 1;\n/ && do {
+ $trace_to_depth = $1 ? $stack_depth||0 + $1 : 1E9;
+ };
# s - single-step. Remember the last command was 's'.
$cmd =~ s/^s\s/\$DB::single = 1;\n/ && do { $laststep = 's' };
@@ -7213,8 +7219,8 @@
B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional.
B<L> [I<a|b|w>] List actions and or breakpoints and or watch-expressions.
B<S> [[B<!>]I<pattern>] List subroutine names [not] matching I<pattern>.
-B<t> Toggle trace mode.
-B<t> I<expr> Trace through execution of I<expr>.
+B<t> [I<n>] Toggle trace mode (to max I<n> levels below current stack depth).
+B<t> [I<n>] I<expr> Trace through execution of I<expr>.
B<b> Sets breakpoint on current line)
B<b> [I<line>] [I<condition>]
Set breakpoint; I<line> defaults to the current execution line;
@@ -7354,7 +7360,7 @@
B</>I<pattern>B</> B<?>I<patt>B<?> Search forw/backw B<r> Return from subroutine
B<M> Show module versions B<c> [I<ln>|I<sub>] Continue until position
I<Debugger controls:> B<L> List break/watch/actions
- B<o> [...] Set debugger options B<t> [I<expr>] Toggle trace [trace expr]
+ B<o> [...] Set debugger options B<t> [I<n>] [I<expr>] Toggle trace [max depth] [trace expr]
B<<>[B<<>]|B<{>[B<{>]|B<>>[B<>>] [I<cmd>] Do pre/post-prompt B<b> [I<ln>|I<event>|I<sub>] [I<cnd>] Set breakpoint
B<$prc> [I<N>|I<pat>] Redo a previous command B<B> I<ln|*> Delete a/all breakpoints
B<H> [I<-num>] Display last num commands B<a> [I<ln>] I<cmd> Do cmd before line
@@ -7405,8 +7411,8 @@
B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional.
B<L> List all breakpoints and actions.
B<S> [[B<!>]I<pattern>] List subroutine names [not] matching I<pattern>.
-B<t> Toggle trace mode.
-B<t> I<expr> Trace through execution of I<expr>.
+B<t> [I<n>] Toggle trace mode (to max I<n> levels below current stack depth).
+B<t> [I<n>] I<expr> Trace through execution of I<expr>.
B<b> [I<line>] [I<condition>]
Set breakpoint; I<line> defaults to the current execution line;
I<condition> breaks if it evaluates to true, defaults to '1'.
@@ -7529,7 +7535,7 @@
B</>I<pattern>B</> B<?>I<patt>B<?> Search forw/backw B<r> Return from subroutine
B<v> Show versions of modules B<c> [I<ln>|I<sub>] Continue until position
I<Debugger controls:> B<L> List break/watch/actions
- B<O> [...] Set debugger options B<t> [I<expr>] Toggle trace [trace expr]
+ B<O> [...] Set debugger options B<t> [I<n>] [I<expr>] Toggle trace [max depth] [trace expr]
B<<>[B<<>]|B<{>[B<{>]|B<>>[B<>>] [I<cmd>] Do pre/post-prompt B<b> [I<ln>|I<event>|I<sub>] [I<cnd>] Set breakpoint
B<$prc> [I<N>|I<pat>] Redo a previous command B<d> [I<ln>] or B<D> Delete a/all breakpoints
B<H> [I<-num>] Display last num commands B<a> [I<ln>] I<cmd> Do cmd before line
--- pod/perldebug.pod.orig 2011-11-21 01:44:24.000000000 -0800
+++ pod/perldebug.pod 2011-11-21 01:46:01.000000000 -0800
@@ -270,16 +270,20 @@
List subroutine names [not] matching the regex.
-=item t
+=item t [n]
X<debugger command, t>
Toggle trace mode (see also the C<AutoTrace> option).
+Optional argument is the maximum number of levels to trace below
+the current one; anything deeper than that will be silent.
-=item t expr
+=item t [n] expr
X<debugger command, t>
Trace through execution of C<expr>.
See L<perldebguts/"Frame Listing Output Examples"> for examples.
+Optional argument is the maximum number of levels to trace below
+the current one; anything deeper than that will be silent.
=item b
X<breakpoint> |
From @shlomifPreferably this patch should include some regression tests - add them to Regards, — Shlomi Fish |
The RT System itself - Status changed from 'new' to 'open' |
From @pjscottOn 11/21/2011 7:45 AM, Shlomi Fish via RT wrote:
Thanks, I took a closer look at that .t and found this process is easier |
From @pjscottInline Patch--- lib/perl5db.t.orig 2011-11-21 09:59:40.000000000 -0800
+++ lib/perl5db.t 2011-11-21 10:21:57.000000000 -0800
@@ -27,7 +27,7 @@
}
}
-plan(9);
+plan(11);
sub rc {
open RC, ">", ".perldb" or die $!;
@@ -167,6 +167,36 @@
like($output, "All tests successful.", "[perl #66110]");
}
+
+# [perl 104168] level option for tracing
+{
+ rc(
+ qq|
+ &parse_options("NonStop=0 ReadLine=0 TTY=db.out LineInfo=db.out");
+ \n|,
+
+ qq|
+ sub afterinit {
+ push(\@DB::typeahead,
+ 't 2',
+ 'c',
+ 'q',
+ );
+ }\n|,
+ );
+
+ my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-104168');
+ my $contents;
+ {
+ local $/;
+ open I, "<", 'db.out' or die $!;
+ $contents = <I>;
+ close(I);
+ }
+ like($contents, qr/level 2/, "[perl #104168]");
+ unlike($contents, qr/baz/, "[perl #104168]");
+}
+
# taint tests
{
--- /dev/null 2011-08-29 21:23:40.775006631 -0700
+++ lib/perl5db/t/rt-104168 2011-11-21 10:18:39.000000000 -0800
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+#
+# This code is used by lib/perl5db.t !!!
+#
+
+foo();
+
+sub foo {
+ bar();
+}
+
+
+sub bar {
+ baz();
+}
+
+sub baz {
+ 1;
+}
+
+1; |
From @pjscottInline Patch--- lib/perl5db.pl.orig 2010-09-05 19:47:29.000000000 -0700
+++ lib/perl5db.pl 2011-11-21 01:42:49.000000000 -0800
@@ -2108,7 +2108,7 @@
"$line:\t$dbline[$line]$after" );
}
else {
- print_lineinfo($position);
+ print_lineinfo($position) if $stack_depth < $trace_to_depth;
}
# Scan forward, stopping at either the end or the next
@@ -2136,7 +2136,7 @@
"$i:\t$dbline[$i]$after" );
}
else {
- print_lineinfo($incr_pos);
+ print_lineinfo($incr_pos) if $stack_depth < $trace_to_depth;
}
} ## end for ($i = $line + 1 ; $i...
} ## end else [ if ($slave_editor)
@@ -2336,17 +2336,21 @@
exit $?;
};
-=head4 C<t> - trace
+=head4 C<t> - trace [n] - trace [to n levels below current stack depth]
Turn tracing on or off. Inverts the appropriate bit in C<$trace> (q.v.).
+If level is specified, set C<$trace_to_depth>.
=cut
- $cmd =~ /^t$/ && do {
+ $cmd =~ /^t(?:\s+(\d+))?$/ && do {
$trace ^= 1;
local $\ = '';
+ $trace_to_depth = $1 ? $stack_depth + $1 : 1E9;
print $OUT "Trace = "
- . ( ( $trace & 1 ) ? "on" : "off" ) . "\n";
+ . ( ( $trace & 1 )
+ ? ( $1 ? "on (to level $trace_to_depth)" : "on" )
+ : "off" ) . "\n";
next CMD;
};
@@ -3417,7 +3421,9 @@
=cut
# t - turn trace on.
- $cmd =~ s/^t\s/\$DB::trace |= 1;\n/;
+ $cmd =~ s/^t\s+(\d+)?/\$DB::trace |= 1;\n/ && do {
+ $trace_to_depth = $1 ? $stack_depth||0 + $1 : 1E9;
+ };
# s - single-step. Remember the last command was 's'.
$cmd =~ s/^s\s/\$DB::single = 1;\n/ && do { $laststep = 's' };
@@ -7213,8 +7219,8 @@
B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional.
B<L> [I<a|b|w>] List actions and or breakpoints and or watch-expressions.
B<S> [[B<!>]I<pattern>] List subroutine names [not] matching I<pattern>.
-B<t> Toggle trace mode.
-B<t> I<expr> Trace through execution of I<expr>.
+B<t> [I<n>] Toggle trace mode (to max I<n> levels below current stack depth).
+B<t> [I<n>] I<expr> Trace through execution of I<expr>.
B<b> Sets breakpoint on current line)
B<b> [I<line>] [I<condition>]
Set breakpoint; I<line> defaults to the current execution line;
@@ -7354,7 +7360,7 @@
B</>I<pattern>B</> B<?>I<patt>B<?> Search forw/backw B<r> Return from subroutine
B<M> Show module versions B<c> [I<ln>|I<sub>] Continue until position
I<Debugger controls:> B<L> List break/watch/actions
- B<o> [...] Set debugger options B<t> [I<expr>] Toggle trace [trace expr]
+ B<o> [...] Set debugger options B<t> [I<n>] [I<expr>] Toggle trace [max depth] [trace expr]
B<<>[B<<>]|B<{>[B<{>]|B<>>[B<>>] [I<cmd>] Do pre/post-prompt B<b> [I<ln>|I<event>|I<sub>] [I<cnd>] Set breakpoint
B<$prc> [I<N>|I<pat>] Redo a previous command B<B> I<ln|*> Delete a/all breakpoints
B<H> [I<-num>] Display last num commands B<a> [I<ln>] I<cmd> Do cmd before line
@@ -7405,8 +7411,8 @@
B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional.
B<L> List all breakpoints and actions.
B<S> [[B<!>]I<pattern>] List subroutine names [not] matching I<pattern>.
-B<t> Toggle trace mode.
-B<t> I<expr> Trace through execution of I<expr>.
+B<t> [I<n>] Toggle trace mode (to max I<n> levels below current stack depth).
+B<t> [I<n>] I<expr> Trace through execution of I<expr>.
B<b> [I<line>] [I<condition>]
Set breakpoint; I<line> defaults to the current execution line;
I<condition> breaks if it evaluates to true, defaults to '1'.
@@ -7529,7 +7535,7 @@
B</>I<pattern>B</> B<?>I<patt>B<?> Search forw/backw B<r> Return from subroutine
B<v> Show versions of modules B<c> [I<ln>|I<sub>] Continue until position
I<Debugger controls:> B<L> List break/watch/actions
- B<O> [...] Set debugger options B<t> [I<expr>] Toggle trace [trace expr]
+ B<O> [...] Set debugger options B<t> [I<n>] [I<expr>] Toggle trace [max depth] [trace expr]
B<<>[B<<>]|B<{>[B<{>]|B<>>[B<>>] [I<cmd>] Do pre/post-prompt B<b> [I<ln>|I<event>|I<sub>] [I<cnd>] Set breakpoint
B<$prc> [I<N>|I<pat>] Redo a previous command B<d> [I<ln>] or B<D> Delete a/all breakpoints
B<H> [I<-num>] Display last num commands B<a> [I<ln>] I<cmd> Do cmd before line
--- pod/perldebug.pod.orig 2011-11-21 01:44:24.000000000 -0800
+++ pod/perldebug.pod 2011-11-21 01:46:01.000000000 -0800
@@ -270,16 +270,20 @@
List subroutine names [not] matching the regex.
-=item t
+=item t [n]
X<debugger command, t>
Toggle trace mode (see also the C<AutoTrace> option).
+Optional argument is the maximum number of levels to trace below
+the current one; anything deeper than that will be silent.
-=item t expr
+=item t [n] expr
X<debugger command, t>
Trace through execution of C<expr>.
See L<perldebguts/"Frame Listing Output Examples"> for examples.
+Optional argument is the maximum number of levels to trace below
+the current one; anything deeper than that will be silent.
=item b
X<breakpoint>
--- lib/perl5db.t.orig 2011-11-21 09:59:40.000000000 -0800
+++ lib/perl5db.t 2011-11-21 10:21:57.000000000 -0800
@@ -27,7 +27,7 @@
}
}
-plan(9);
+plan(11);
sub rc {
open RC, ">", ".perldb" or die $!;
@@ -167,6 +167,36 @@
like($output, "All tests successful.", "[perl #66110]");
}
+
+# [perl 104168] level option for tracing
+{
+ rc(
+ qq|
+ &parse_options("NonStop=0 ReadLine=0 TTY=db.out LineInfo=db.out");
+ \n|,
+
+ qq|
+ sub afterinit {
+ push(\@DB::typeahead,
+ 't 2',
+ 'c',
+ 'q',
+ );
+ }\n|,
+ );
+
+ my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-104168');
+ my $contents;
+ {
+ local $/;
+ open I, "<", 'db.out' or die $!;
+ $contents = <I>;
+ close(I);
+ }
+ like($contents, qr/level 2/, "[perl #104168]");
+ unlike($contents, qr/baz/, "[perl #104168]");
+}
+
# taint tests
{
--- /dev/null 2011-08-29 21:23:40.775006631 -0700
+++ lib/perl5db/t/rt-104168 2011-11-21 10:18:39.000000000 -0800
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+#
+# This code is used by lib/perl5db.t !!!
+#
+
+foo();
+
+sub foo {
+ bar();
+}
+
+
+sub bar {
+ baz();
+}
+
+sub baz {
+ 1;
+}
+
+1; |
From @shlomifOn Mon, 21 Nov 2011 10:27:41 -0800
Well, patch.combined does not apply correctly against bleadperl (at least not [SHELL] shlomif@telaviv1:~/Download/unpack/perl/p5/git/perl$ patch -p0 < ~/patch.combined [/SHELL] Otherwise, here are a few notes about it: } # Scan forward, stopping at either the end or the next There's some duplicate functionality here. You should extract a subroutine or sub depth_print_lineinfo { Also, the variable $trace_to_depth appeared out of the blue. Is it a global - The $trace_to_depth is out of indentation. Please check appropriate leading tabs Plus, you shouldn't use $1 in the "print $OUT" statement. Set a lexical variable - $cmd =~ s/^t\s/\$DB::trace |= 1;\n/; Again mixed indentation. Otherwise looks fine. Regards, Shlomi Fish -- Shlomi Fish http://www.shlomifish.org/ In Soviet Russia, every time you kill a kitten, God masturbates. Please reply to list if it's a mailing list post - http://shlom.in/reply . |
From @shlomifBegin forwarded message: Date: Tue, 22 Nov 2011 11:01:09 +0200 On Mon, 21 Nov 2011 10:27:41 -0800
Well, patch.combined does not apply correctly against bleadperl (at least not [SHELL] shlomif@telaviv1:~/Download/unpack/perl/p5/git/perl$ patch -p0 < [/SHELL] Otherwise, here are a few notes about it: } # Scan forward, stopping at either the end or the next There's some duplicate functionality here. You should extract a subroutine or sub depth_print_lineinfo { Also, the variable $trace_to_depth appeared out of the blue. Is it a global - The $trace_to_depth is out of indentation. Please check appropriate leading tabs Plus, you shouldn't use $1 in the "print $OUT" statement. Set a lexical variable - $cmd =~ s/^t\s/\$DB::trace |= 1;\n/; Again mixed indentation. Otherwise looks fine. Regards, Shlomi Fish -- Shlomi Fish http://www.shlomifish.org/ In Soviet Russia, every time you kill a kitten, God masturbates. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- Shlomi Fish http://www.shlomifish.org/ * Backward compatibility is your worst enemy. Please reply to list if it's a mailing list post - http://shlom.in/reply . |
From @shlomifForwarding to the list, as this message was sent to me alone. Regards, Shlomi Fish Begin forwarded message: Date: Wed, 23 Nov 2011 13:43:36 -0800 Thanks, Shlomi. On 11/22/2011 1:01 AM, Shlomi Fish wrote:
Done. -- Shlomi Fish http://www.shlomifish.org/ Q2: Busy people are unproductive. We are very productive and so we’re never Please reply to list if it's a mailing list post - http://shlom.in/reply . |
From @shlomifInline Patch--- pod/perldebug.pod.orig 2011-11-22 16:28:16.000000000 -0800
+++ pod/perldebug.pod 2011-11-23 13:08:56.000000000 -0800
@@ -269,15 +269,19 @@
List subroutine names [not] matching the regex.
-=item t
+=item t [n]
X<debugger command, t>
Toggle trace mode (see also the C<AutoTrace> option).
+Optional argument is the maximum number of levels to trace below
+the current one; anything deeper than that will be silent.
-=item t expr
+=item t [n] expr
X<debugger command, t>
Trace through execution of C<expr>.
+Optional first argument is the maximum number of levels to trace below
+the current one; anything deeper than that will be silent.
See L<perldebguts/"Frame Listing Output Examples"> for examples.
=item b
--- lib/perl5db.pl.orig 2011-11-22 16:28:16.000000000 -0800
+++ lib/perl5db.pl 2011-11-23 13:26:34.000000000 -0800
@@ -2115,7 +2115,7 @@
"$line:\t$dbline[$line]$after" );
}
else {
- print_lineinfo($position);
+ depth_print_lineinfo($position);
}
# Scan forward, stopping at either the end or the next
@@ -2143,7 +2143,7 @@
"$i:\t$dbline[$i]$after" );
}
else {
- print_lineinfo($incr_pos);
+ depth_print_lineinfo($incr_pos);
}
} ## end for ($i = $line + 1 ; $i...
} ## end else [ if ($slave_editor)
@@ -2343,17 +2343,22 @@
exit $?;
};
-=head4 C<t> - trace
+=head4 C<t> - trace [n]
Turn tracing on or off. Inverts the appropriate bit in C<$trace> (q.v.).
+If level is specified, set C<$trace_to_depth>.
=cut
- $cmd =~ /^t$/ && do {
+ $cmd =~ /^t(?:\s+(\d+))?$/ && do {
+ my $levels = $1;
$trace ^= 1;
local $\ = '';
+ $trace_to_depth = $levels ? $stack_depth + $levels : 1E9;
print $OUT "Trace = "
- . ( ( $trace & 1 ) ? "on" : "off" ) . "\n";
+ . ( ( $trace & 1 )
+ ? ( $levels ? "on (to level $trace_to_depth)" : "on" )
+ : "off" ) . "\n";
next CMD;
};
@@ -3456,7 +3461,9 @@
=cut
# t - turn trace on.
- $cmd =~ s/^t\s/\$DB::trace |= 1;\n/;
+ $cmd =~ s/^t\s+(\d+)?/\$DB::trace |= 1;\n/ && do {
+ $trace_to_depth = $1 ? $stack_depth||0 + $1 : 1E9;
+ };
# s - single-step. Remember the last command was 's'.
$cmd =~ s/^s\s/\$DB::single = 1;\n/ && do { $laststep = 's' };
@@ -3880,6 +3887,11 @@
&$sub;
}
+# Abstracting common code from multiple places elsewhere:
+sub depth_print_lineinfo {
+ print_lineinfo( @_ ) if $stack_depth < $trace_to_depth;
+}
+
=head1 EXTENDED COMMAND HANDLING AND THE COMMAND API
In Perl 5.8.0, there was a major realignment of the commands and what they did,
@@ -7327,8 +7339,8 @@
B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional.
B<L> [I<a|b|w>] List actions and or breakpoints and or watch-expressions.
B<S> [[B<!>]I<pattern>] List subroutine names [not] matching I<pattern>.
-B<t> Toggle trace mode.
-B<t> I<expr> Trace through execution of I<expr>.
+B<t> [I<n>] Toggle trace mode (to max I<n> levels below current stack depth).
+B<t> [I<n>] I<expr> Trace through execution of I<expr>.
B<b> Sets breakpoint on current line)
B<b> [I<line>] [I<condition>]
Set breakpoint; I<line> defaults to the current execution line;
@@ -7468,7 +7480,7 @@
B</>I<pattern>B</> B<?>I<patt>B<?> Search forw/backw B<r> Return from subroutine
B<M> Show module versions B<c> [I<ln>|I<sub>] Continue until position
I<Debugger controls:> B<L> List break/watch/actions
- B<o> [...] Set debugger options B<t> [I<expr>] Toggle trace [trace expr]
+ B<o> [...] Set debugger options B<t> [I<n>] [I<expr>] Toggle trace [max depth] ][trace expr]
B<<>[B<<>]|B<{>[B<{>]|B<>>[B<>>] [I<cmd>] Do pre/post-prompt B<b> [I<ln>|I<event>|I<sub>] [I<cnd>] Set breakpoint
B<$prc> [I<N>|I<pat>] Redo a previous command B<B> I<ln|*> Delete a/all breakpoints
B<H> [I<-num>] Display last num commands B<a> [I<ln>] I<cmd> Do cmd before line
@@ -7519,8 +7531,8 @@
B<?>I<pattern>B<?> Search backwards for I<pattern>; final B<?> is optional.
B<L> List all breakpoints and actions.
B<S> [[B<!>]I<pattern>] List subroutine names [not] matching I<pattern>.
-B<t> Toggle trace mode.
-B<t> I<expr> Trace through execution of I<expr>.
+B<t> [I<n>] Toggle trace mode (to max I<n> levels below current stack depth) .
+B<t> [I<n>] I<expr> Trace through execution of I<expr>.
B<b> [I<line>] [I<condition>]
Set breakpoint; I<line> defaults to the current execution line;
I<condition> breaks if it evaluates to true, defaults to '1'.
--- lib/perl5db.t.orig 2011-10-04 10:55:47.000000000 -0700
+++ lib/perl5db.t 2011-11-23 13:38:06.000000000 -0800
@@ -28,7 +28,7 @@
}
}
-plan(14);
+plan(16);
my $rc_filename = '.perldb';
@@ -210,6 +210,33 @@
like($output, "All tests successful.", "[perl #66110]");
}
+# [perl 104168] level option for tracing
+{
+ rc(<<'EOF');
+&parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
+
+sub afterinit {
+ push (@DB::typeahead,
+ 't 2',
+ 'c',
+ 'q',
+ );
+
+}
+EOF
+
+ my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-104168');
+ my $contents;
+ {
+ local $/;
+ open I, "<", 'db.out' or die $!;
+ $contents = <I>;
+ close(I);
+ }
+ like($contents, qr/level 2/, "[perl #104168]");
+ unlike($contents, qr/baz/, "[perl #104168]");
+}
+
# taint tests
{
--- /dev/null 2011-08-29 21:23:40.775006631 -0700
+++ lib/perl5db/t/rt-104168 2011-11-22 18:12:11.000000000 -0800
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+#
+# This code is used by lib/perl5db.t !!!
+#
+
+foo();
+
+sub foo {
+ bar();
+}
+
+
+sub bar {
+ baz();
+}
+
+sub baz {
+ 1;
+}
+
+1; |
From @shlomifHi Peter, On Thu, 24 Nov 2011 09:09:37 +0200
Well, next time you can use the "git diff" command.
OK.
OK.
Nice. Well, I have tested your patch on a local git branch. All tests pass except for <<< I don't think any of this is your fault, but I still don't know how to fix it. Regards, Shlomi Fish -- Shlomi Fish http://www.shlomifish.org/ I invented the term Object‐Oriented, and I can tell you I did not have C++ in Please reply to list if it's a mailing list post - http://shlom.in/reply . |
From @cpansproutOn Wed Nov 23 23:10:19 2011, shlomif@shlomifish.org wrote:
Thank you. Applied as 611272b. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
From @cpansproutOn Thu Nov 24 00:01:37 2011, shlomif@shlomifish.org wrote:
In the test names. :-) I suspect you used spaces instead of tabs in MANIFEST. You can get verbose test output with: cd t; ./perl TEST porting/{filenames,manifest}.t It cuts off output on the first failure. -- Father Chrysostomos |
Migrated from rt.perl.org#104168 (status was 'resolved')
Searchable as RT104168$
The text was updated successfully, but these errors were encountered: