14 if (! -c "/dev/null") {
15 print "1..0 # Skip: no /dev/null\n";
19 my $dev_tty = '/dev/tty';
20 $dev_tty = 'TT:' if ($^O eq 'VMS');
22 print "1..0 # Skip: no $dev_tty\n";
26 print "1..0 # Skip: \$ENV{PERL5DB} is already set to '$ENV{PERL5DB}'\n";
33 my $rc_filename = '.perldb';
36 open my $rc_fh, '>', $rc_filename
41 # overly permissive perms gives "Must not source insecure rcfile"
42 # and hangs at the DB(1> prompt
43 chmod 0644, $rc_filename;
50 open my $in, '<', $filename
51 or die "Cannot open '$filename' for slurping - $!";
61 my $out_fn = 'db.out';
65 return _slurp($out_fn);
70 my $target = '../lib/perl5db/t/eval-line-bug';
74 &parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
81 'x "new_var = <\$new_var>\\n";',
89 local $ENV{PERLDB_OPTS} = "ReadLine=0";
90 runperl(switches => [ '-d' ], progfile => $target);
94 like(_out_contents(), qr/new_var = <Foo>/,
95 "no strict 'vars' in evaluated lines.",
99 local $ENV{PERLDB_OPTS} = "ReadLine=0";
100 my $output = runperl(switches => [ '-d' ], progfile => '../lib/perl5db/t/lvalue-bug');
101 like($output, qr/foo is defined/, 'lvalue subs work in the debugger');
105 local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
106 my $output = runperl(switches => [ '-d' ], progfile => '../lib/perl5db/t/symbol-table-bug');
107 like($output, qr/Undefined symbols 0/, 'there are no undefined values in the symbol table');
111 if ( $Config{usethreads} ) {
112 skip('This perl has threads, skipping non-threaded debugger tests');
114 my $error = 'This Perl not built to support threads';
115 my $output = runperl( switches => [ '-dt' ], stderr => 1 );
116 like($output, qr/$error/, 'Perl debugger correctly complains that it was not built with threads');
121 if ( $Config{usethreads} ) {
122 local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
123 my $output = runperl(switches => [ '-dt' ], progfile => '../lib/perl5db/t/symbol-table-bug');
124 like($output, qr/Undefined symbols 0/, 'there are no undefined values in the symbol table when running with thread support');
126 skip("This perl is not threaded, skipping threaded debugger tests");
133 local $ENV{PERLDB_OPTS};
136 &parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
147 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-61222');
148 unlike(_out_contents(), qr/INCORRECT/, "[perl #61222]");
153 # Test for Proxy constants
158 &parse_options("NonStop=0 ReadLine=0 TTY=db.out LineInfo=db.out");
170 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/proxy-constants');
171 is($output, "", "proxy constant subroutines");
174 # [perl #66110] Call a subroutine inside a regex
176 local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
177 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-66110');
178 like($output, "All tests successful.", "[perl #66110]");
181 # [perl 104168] level option for tracing
184 &parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
187 push (@DB::typeahead,
196 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-104168');
197 my $contents = _out_contents();
198 like($contents, qr/level 2/, "[perl #104168]");
199 unlike($contents, qr/baz/, "[perl #104168]");
205 local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
206 my $output = runperl(switches => [ '-d', '-T' ], stderr => 1,
207 progfile => '../lib/perl5db/t/taint');
208 chomp $output if $^O eq 'VMS'; # newline guaranteed at EOF
209 is($output, '[$^X][done]', "taint");
217 my $self = bless {}, $class;
228 $self->{_cmds} = shift;
231 return $self->{_cmds};
238 $self->{_prog} = shift;
241 return $self->{_prog};
248 $self->{_output} = shift;
251 return $self->{_output};
260 $self->{_include_t} = shift;
263 return $self->{_include_t};
272 $self->{_contents} = shift;
275 return $self->{_contents};
280 my ($self, $args) = @_;
282 my $cmds = $args->{cmds};
284 if (ref($cmds) ne 'ARRAY') {
285 die "cmds must be an array of commands.";
290 my $prog = $args->{prog};
292 if (ref($prog) ne '' or !defined($prog)) {
293 die "prog should be a path to a program file.";
298 $self->_include_t($args->{include_t} ? 1 : 0);
307 my ($self, $str) = @_;
309 $str =~ s/(["\@\$\\])/\\$1/g;
319 my $rc = qq{&parse_options("NonStop=0 TTY=db.out LineInfo=db.out");\n};
324 q#push (@DB::typeahead,#,
325 (map { $self->_quote($_) . "," } @{$self->_cmds()}),
331 # I guess two objects like that cannot be used at the same time.
340 ($self->_include_t ? ('-I', '../lib/perl5db/t') : ())
343 progfile => $self->_prog()
346 $self->_output($output);
348 $self->_contents(::_out_contents());
354 my ($self, $re, $msg) = @_;
356 local $::Level = $::Level + 1;
357 ::like($self->_output(), $re, $msg);
361 my ($self, $re, $msg) = @_;
363 local $::Level = $::Level + 1;
364 ::unlike($self->_output(), $re, $msg);
368 my ($self, $re, $msg) = @_;
370 local $::Level = $::Level + 1;
371 ::like($self->_contents(), $re, $msg);
374 sub contents_unlike {
375 my ($self, $re, $msg) = @_;
377 local $::Level = $::Level + 1;
378 ::unlike($self->_contents(), $re, $msg);
384 local $ENV{PERLDB_OPTS} = "ReadLine=0";
385 my $target = '../lib/perl5db/t/eval-line-bug';
386 my $wrapper = DebugWrap->new(
396 "p \@{'main::_<$target'}",
402 $wrapper->contents_like(
404 'The ${main::_<filename} variable in the debugger was not destroyed',
408 # Testing that we can set a line in the middle of the file.
410 my $wrapper = DebugWrap->new(
414 'b ../lib/perl5db/t/MyModule.pm:12',
416 q/do { use IO::Handle; STDOUT->autoflush(1); print "Var=$var\n"; }/,
421 prog => '../lib/perl5db/t/filename-line-breakpoint'
425 $wrapper->output_like(qr/
433 "Can set breakpoint in a line in the middle of the file.");
436 # Testing that we can set a breakpoint
438 my $wrapper = DebugWrap->new(
440 prog => '../lib/perl5db/t/breakpoint-bug',
445 q/do { use IO::Handle; STDOUT->autoflush(1); print "X={$x}\n"; }/,
452 $wrapper->output_like(
454 "Can set breakpoint in a line."
458 # Testing that we can disable a breakpoint at a numeric line.
460 my $wrapper = DebugWrap->new(
462 prog => '../lib/perl5db/t/disable-breakpoints-1',
469 q/print "X={$x}\n";/,
476 $wrapper->output_like(qr/X=\{SecondVal\}/ms,
477 "Can set breakpoint in a line.");
480 # Testing that we can re-enable a breakpoint at a numeric line.
482 my $wrapper = DebugWrap->new(
484 prog => '../lib/perl5db/t/disable-breakpoints-2',
493 q/print "X={$x}\n";/,
500 $wrapper->output_like(
502 X=\{SecondValOneHundred\}
504 "Can set breakpoint in a line."
509 # Disable and enable for breakpoints on outer files.
511 my $wrapper = DebugWrap->new(
516 'b ../lib/perl5db/t/EnableModule.pm:14',
517 'disable ../lib/perl5db/t/EnableModule.pm:14',
519 'enable ../lib/perl5db/t/EnableModule.pm:14',
521 q/print "X={$x}\n";/,
525 prog => '../lib/perl5db/t/disable-breakpoints-3',
530 $wrapper->output_like(qr/
531 X=\{SecondValTwoHundred\}
533 "Can set breakpoint in a line.");
536 # Testing that the prompt with the information appears.
538 my $wrapper = DebugWrap->new(
541 prog => '../lib/perl5db/t/disable-breakpoints-1',
545 $wrapper->contents_like(qr/
546 ^main::\([^\)]*\bdisable-breakpoints-1:2\):\n
547 2:\s+my\ \$x\ =\ "One";\n
549 "Prompt should display the first line of code.");
552 # Testing that R (restart) and "B *" work.
554 my $wrapper = DebugWrap->new(
564 q/print "X={$x};dummy={$dummy}\n";/,
567 prog => '../lib/perl5db/t/disable-breakpoints-1',
571 $wrapper->output_like(qr/
572 X=\{FirstVal\};dummy=\{1\}
574 "Restart and delete all breakpoints work properly.");
578 my $wrapper = DebugWrap->new(
583 q/print "X={$x}\n";/,
587 prog => '../lib/perl5db/t/disable-breakpoints-1',
591 $wrapper->output_like(qr/
594 "'c line_num' is working properly.");
598 my $wrapper = DebugWrap->new(
606 q/print "Exp={$exp}\n";/,
609 prog => '../lib/perl5db/t/break-on-dot',
613 $wrapper->output_like(qr/
616 "'b .' is working correctly.");
619 # Testing that the prompt with the information appears inside a subroutine call.
620 # See https://rt.perl.org/rt3/Ticket/Display.html?id=104820
622 my $wrapper = DebugWrap->new(
629 prog => '../lib/perl5db/t/with-subroutine',
633 $wrapper->contents_like(
635 ^main::back\([^\)\n]*\bwith-subroutine:15\):[\ \t]*\n
636 ^15:\s*print\ "hello\ back\\n";
638 "Prompt should display the line of code inside a subroutine.");
641 # Checking that the p command works.
643 my $wrapper = DebugWrap->new(
647 'p "<<<" . (4*6) . ">>>"',
650 prog => '../lib/perl5db/t/with-subroutine',
654 $wrapper->contents_like(
661 my $wrapper = DebugWrap->new(
668 prog => '../lib/perl5db/t/with-subroutine',
672 $wrapper->contents_like(
673 # qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/,
674 qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/ms,
679 # Tests for "T" (stack trace).
681 my $prog_fn = '../lib/perl5db/t/rt-104168';
682 my $wrapper = DebugWrap->new(
693 my $re_text = join('',
696 "%s = %s\\(\\) called from file " .
697 "'" . quotemeta($prog_fn) . "' line %s\\n",
698 (map { quotemeta($_) } @$_)
702 ['.', 'main::baz', 14,],
703 ['.', 'main::bar', 9,],
704 ['.', 'main::foo', 6],
707 $wrapper->contents_like(
708 # qr/^0\s+HASH\([^\)]+\)\n\s+500 => 600\n/,
716 my $wrapper = DebugWrap->new(
723 q/print "X={$x};dummy={$dummy}\n";/,
726 prog => '../lib/perl5db/t/disable-breakpoints-1'
730 $wrapper->output_like(qr/
731 X=\{SecondVal\};dummy=\{1\}
733 'test for s - single step',
738 my $wrapper = DebugWrap->new(
746 q/print "Exp={$exp}\n";/,
749 prog => '../lib/perl5db/t/break-on-dot'
753 $wrapper->output_like(qr/
756 "'b .' is working correctly.");
760 my $prog_fn = '../lib/perl5db/t/rt-104168';
761 my $wrapper = DebugWrap->new(
772 $wrapper->contents_like(
774 ^main::foo\([^\)\n]*\brt-104168:9\):[\ \t]*\n
777 'Test for the s command.',
782 my $wrapper = DebugWrap->new(
786 's uncalled_subroutine()',
791 prog => '../lib/perl5db/t/uncalled-subroutine'}
794 $wrapper->output_like(
796 'uncalled_subroutine was called after s EXPR()',
801 my $wrapper = DebugWrap->new(
805 'n uncalled_subroutine()',
809 prog => '../lib/perl5db/t/uncalled-subroutine',
813 $wrapper->output_like(
815 'uncalled_subroutine was called after n EXPR()',
820 my $wrapper = DebugWrap->new(
832 prog => '../lib/perl5db/t/fact',
836 $wrapper->output_like(
838 'b subroutine works fine',
842 # Test for 'M' (module list).
844 my $wrapper = DebugWrap->new(
851 prog => '../lib/perl5db/t/load-modules'
855 $wrapper->contents_like(
857 'M (module list) works fine',
862 my $wrapper = DebugWrap->new(
870 'print "Var=$var\n";',
873 prog => '../lib/perl5db/t/test-r-statement',
877 $wrapper->output_like(
885 'r statement is working properly.',
890 my $wrapper = DebugWrap->new(
897 prog => '../lib/perl5db/t/test-l-statement-1',
901 $wrapper->contents_like(
904 2:\s+print\ "1\\n";\n
907 5:\s+print\ "2\\n";\n
909 'l statement is working properly (test No. 1).',
914 my $wrapper = DebugWrap->new(
926 prog => '../lib/perl5db/t/test-l-statement-1',
930 my $first_l_out = qr/
932 2:\s+print\ "1\\n";\n
935 5:\s+print\ "2\\n";\n
938 8:\s+print\ "3\\n";\n
943 my $second_l_out = qr/
944 11:\s+print\ "4\\n";\n
947 14:\s+print\ "5\\n";\n
950 17:\s+print\ "6\\n";\n
953 20:\s+print\ "7\\n";\n
955 $wrapper->contents_like(
958 [^\n]*?DB<\d+>\ \#\ After\ l\ 1\n
960 [^\n]*?DB<\d+>\ l\s*\n
962 [^\n]*?DB<\d+>\ \#\ After\ l\ 2\n
964 [^\n]*?DB<\d+>\ -\s*\n
966 [^\n]*?DB<\d+>\ \#\ After\ -\n
968 'l followed by l and then followed by -',
973 my $wrapper = DebugWrap->new(
980 prog => '../lib/perl5db/t/test-l-statement-2',
984 my $first_l_out = qr/
986 7:\s+my\ \$n\ =\ shift;\n
987 8:\s+if\ \(\$n\ >\ 1\)\ \{\n
988 9:\s+return\ \$n\ \*\ fact\(\$n\ -\ 1\);
991 $wrapper->contents_like(
1001 my $wrapper = DebugWrap->new(
1007 # Repeat several times to avoid @typeahead problems.
1014 prog => '../lib/perl5db/t/test-l-statement-2',
1019 ^main::fact\([^\n]*?:7\):\n
1020 ^7:\s+my\ \$n\ =\ shift;\n
1023 $wrapper->contents_like(
1028 'Test the "." command',
1032 # Testing that the f command works.
1034 my $wrapper = DebugWrap->new(
1038 'f ../lib/perl5db/t/MyModule.pm',
1041 q/do { use IO::Handle; STDOUT->autoflush(1); print "Var=$var\n"; }/,
1046 prog => '../lib/perl5db/t/filename-line-breakpoint'
1050 $wrapper->output_like(qr/
1058 "f command is working.",
1062 # We broke the /pattern/ command because apparently the CORE::eval-s inside
1063 # lib/perl5db.pl cannot handle lexical variable properly. So we now fix this
1068 # 1. Go over the rest of the "eval"s in lib/perl5db.t and see if they cause
1071 my $wrapper = DebugWrap->new(
1078 prog => '../lib/perl5db/t/eval-line-bug',
1082 $wrapper->contents_like(
1083 qr/12: \s* for\ my\ \$q\ \(1\ \.\.\ 10\)\ \{/msx,
1084 "/pat/ command is working and found a match.",
1089 my $wrapper = DebugWrap->new(
1098 prog => '../lib/perl5db/t/eval-line-bug',
1102 $wrapper->contents_like(
1103 qr/12: \s* for\ my\ \$q\ \(1\ \.\.\ 10\)\ \{/msx,
1104 "?pat? command is working and found a match.",
1108 # Test the L command.
1110 my $wrapper = DebugWrap->new(
1119 prog => '../lib/perl5db/t/eval-line-bug',
1123 $wrapper->contents_like(
1125 ^\S*?eval-line-bug:\n
1126 \s*6:\s*my\ \$i\ =\ 5;\n
1127 \s*break\ if\ \(1\)\n
1128 \s*13:\s*\$i\ \+=\ \$q;\n
1129 \s*break\ if\ \(\(\$q\ ==\ 5\)\)\n
1131 "L command is listing breakpoints",
1135 # Test the L command for watch expressions.
1137 my $wrapper = DebugWrap->new(
1145 prog => '../lib/perl5db/t/eval-line-bug',
1149 $wrapper->contents_like(
1151 ^Watch-expressions:\n
1154 "L command is listing watch expressions",
1159 my $wrapper = DebugWrap->new(
1169 prog => '../lib/perl5db/t/eval-line-bug',
1173 $wrapper->contents_like(
1175 ^Watch-expressions:\n
1179 "L command is not listing deleted watch expressions",
1183 # Test the L command.
1185 my $wrapper = DebugWrap->new(
1194 prog => '../lib/perl5db/t/eval-line-bug',
1198 $wrapper->contents_like(
1200 ^\S*?eval-line-bug:\n
1201 \s*6:\s*my\ \$i\ =\ 5;\n
1202 \s*break\ if\ \(1\)\n
1203 \s*13:\s*\$i\ \+=\ \$q;\n
1204 \s*action:\s+print\ \$i\n
1206 "L command is listing actions and breakpoints",
1211 my $wrapper = DebugWrap->new(
1218 prog => '../lib/perl5db/t/rt-104168',
1222 $wrapper->contents_like(
1233 my $wrapper = DebugWrap->new(
1240 prog => '../lib/perl5db/t/rt-104168',
1244 $wrapper->contents_like(
1250 "S command with regex",
1255 my $wrapper = DebugWrap->new(
1262 prog => '../lib/perl5db/t/rt-104168',
1266 $wrapper->contents_unlike(
1270 "S command with negative regex",
1273 $wrapper->contents_like(
1277 "S command with negative regex - what it still matches",
1281 # Test the a command.
1283 my $wrapper = DebugWrap->new(
1287 'a 13 print "\nVar<Q>=$q\n"',
1291 prog => '../lib/perl5db/t/eval-line-bug',
1295 $wrapper->output_like(qr#
1300 "a command is working",
1304 # Test the 'A' command
1306 my $wrapper = DebugWrap->new(
1310 'a 13 print "\nVar<Q>=$q\n"',
1315 prog => '../lib/perl5db/t/eval-line-bug',
1319 $wrapper->output_like(
1320 qr#\A\z#msx, # The empty string.
1321 "A command (for removing actions) is working",
1325 # Test the 'A *' command
1327 my $wrapper = DebugWrap->new(
1331 'a 6 print "\nFail!\n"',
1332 'a 13 print "\nVar<Q>=$q\n"',
1337 prog => '../lib/perl5db/t/eval-line-bug',
1341 $wrapper->output_like(
1342 qr#\A\z#msx, # The empty string.
1343 "'A *' command (for removing all actions) is working",
1348 my $wrapper = DebugWrap->new(
1355 'print "\nIDX=<$idx>\n"',
1358 prog => '../lib/perl5db/t/test-w-statement-1',
1363 $wrapper->contents_like(qr#
1365 \s+old\ value:\s+'1'\n
1366 \s+new\ value:\s+'2'\n
1368 'w command - watchpoint changed',
1370 $wrapper->output_like(qr#
1373 "w command - correct output from IDX",
1378 my $wrapper = DebugWrap->new(
1386 'print "\nIDX=<$idx>\n"',
1389 prog => '../lib/perl5db/t/test-w-statement-1',
1393 $wrapper->contents_unlike(qr#
1396 'W command - watchpoint was deleted',
1399 $wrapper->output_like(qr#
1402 "W command - stopped at end.",
1406 # Test the W * command.
1408 my $wrapper = DebugWrap->new(
1417 'print "\nIDX=<$idx>\n"',
1420 prog => '../lib/perl5db/t/test-w-statement-1',
1424 $wrapper->contents_unlike(qr#
1427 '"W *" command - watchpoint was deleted',
1430 $wrapper->output_like(qr#
1433 '"W *" command - stopped at end.',
1437 # Test the 'o' command (without further arguments).
1439 my $wrapper = DebugWrap->new(
1446 prog => '../lib/perl5db/t/test-w-statement-1',
1450 $wrapper->contents_like(qr#
1451 ^\s*warnLevel\ =\ '1'\n
1453 q#"o" command (without arguments) displays warnLevel#,
1456 $wrapper->contents_like(qr#
1457 ^\s*signalLevel\ =\ '1'\n
1459 q#"o" command (without arguments) displays signalLevel#,
1462 $wrapper->contents_like(qr#
1463 ^\s*dieLevel\ =\ '1'\n
1465 q#"o" command (without arguments) displays dieLevel#,
1468 $wrapper->contents_like(qr#
1469 ^\s*hashDepth\ =\ 'N/A'\n
1471 q#"o" command (without arguments) displays hashDepth#,
1475 # Test the 'o' query command.
1477 my $wrapper = DebugWrap->new(
1481 'o hashDepth? signalLevel?',
1484 prog => '../lib/perl5db/t/test-w-statement-1',
1488 $wrapper->contents_unlike(qr#warnLevel#,
1489 q#"o" query command does not display warnLevel#,
1492 $wrapper->contents_like(qr#
1493 ^\s*signalLevel\ =\ '1'\n
1495 q#"o" query command displays signalLevel#,
1498 $wrapper->contents_unlike(qr#dieLevel#,
1499 q#"o" query command does not display dieLevel#,
1502 $wrapper->contents_like(qr#
1503 ^\s*hashDepth\ =\ 'N/A'\n
1505 q#"o" query command displays hashDepth#,
1509 # Test the 'o' set command.
1511 my $wrapper = DebugWrap->new(
1519 prog => '../lib/perl5db/t/test-w-statement-1',
1523 $wrapper->contents_like(qr/
1524 ^\s*(signalLevel\ =\ '0'\n)
1528 q#o set command works#,
1531 $wrapper->contents_like(qr#
1532 ^\s*hashDepth\ =\ 'N/A'\n
1534 q#o set command - hashDepth#,
1538 # Test the '<' and "< ?" commands.
1540 my $wrapper = DebugWrap->new(
1544 q/< print "\nX=<$x>\n"/,
1550 prog => '../lib/perl5db/t/disable-breakpoints-1',
1554 $wrapper->contents_like(qr/
1555 ^pre-perl\ commands:\n
1556 \s*<\ --\ print\ "\\nX=<\$x>\\n"\n
1558 q#Test < and < ? commands - contents.#,
1561 $wrapper->output_like(qr#
1564 q#Test < and < ? commands - output.#,
1568 # Test the '< *' command.
1570 my $wrapper = DebugWrap->new(
1574 q/< print "\nX=<$x>\n"/,
1580 prog => '../lib/perl5db/t/disable-breakpoints-1',
1584 $wrapper->output_unlike(qr/FirstVal/,
1585 q#Test the '< *' command.#,
1589 # Test the '>' and "> ?" commands.
1591 my $wrapper = DebugWrap->new(
1596 q/> print "\nFOO=<$::foo>\n"/,
1602 prog => '../lib/perl5db/t/disable-breakpoints-1',
1606 $wrapper->contents_like(qr/
1607 ^post-perl\ commands:\n
1608 \s*>\ --\ print\ "\\nFOO=<\$::foo>\\n"\n
1610 q#Test > and > ? commands - contents.#,
1613 $wrapper->output_like(qr#
1616 q#Test > and > ? commands - output.#,
1620 # Test the '> *' command.
1622 my $wrapper = DebugWrap->new(
1626 q/> print "\nFOO=<$::foo>\n"/,
1632 prog => '../lib/perl5db/t/disable-breakpoints-1',
1636 $wrapper->output_unlike(qr/FOO=/,
1637 q#Test the '> *' command.#,
1641 # Test the < and > commands together
1643 my $wrapper = DebugWrap->new(
1648 q/< $::lorem += 10;/,
1649 q/> print "\nLOREM=<$::lorem>\n"/,
1656 prog => '../lib/perl5db/t/disable-breakpoints-1',
1660 $wrapper->output_like(qr#
1663 q#Test < and > commands. #,
1667 # Test the { ? and { [command] commands.
1669 my $wrapper = DebugWrap->new(
1680 prog => '../lib/perl5db/t/disable-breakpoints-1',
1684 $wrapper->contents_like(qr#
1685 ^No\ pre-debugger\ actions\.\n
1687 ^pre-debugger\ commands:\n
1690 ^5==>b\s+\$x\ =\ "FirstVal";\n
1694 9:\s+\$x\ =\ "SecondVal";\n
1697 'Test the pre-prompt debugger commands',
1701 # Test the { * command.
1703 my $wrapper = DebugWrap->new(
1711 q/print (("One" x 5), "\n");/,
1714 prog => '../lib/perl5db/t/disable-breakpoints-1',
1718 $wrapper->contents_like(qr#
1719 ^All\ \{\ actions\ cleared\.\n
1721 'Test the { * command',
1724 $wrapper->output_like(qr/OneOneOneOneOne/,
1725 '{ * test - output is OK.',
1729 # Test the ! command.
1731 my $wrapper = DebugWrap->new(
1739 prog => '../lib/perl5db/t/disable-breakpoints-1',
1743 $wrapper->contents_like(qr#
1744 (^3:\s+my\ \$dummy\ =\ 0;\n
1746 5:\s+\$x\ =\ "FirstVal";)\n
1751 'Test the ! command (along with l 3-5)',
1755 # Test the ! -number command.
1757 my $wrapper = DebugWrap->new(
1766 prog => '../lib/perl5db/t/disable-breakpoints-1',
1770 $wrapper->contents_like(qr#
1771 (^3:\s+my\ \$dummy\ =\ 0;\n
1773 5:\s+\$x\ =\ "FirstVal";)\n
1775 ^2==\>\s+my\ \$x\ =\ "One";\n
1780 'Test the ! -n command (along with l)',
1785 1 while unlink ($rc_filename, $out_fn);