develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #118157] debugger's doc command broken in 5.18.0

Thread Next
From:
Nicholas Clark
Date:
May 24, 2013 18:22
Subject:
[perl #118157] debugger's doc command broken in 5.18.0
Message ID:
rt-3.6.HEAD-2650-1369419689-1373.118157-75-0@perl.org
# New Ticket Created by  Nicholas Clark 
# Please include the string:  [perl #118157]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118157 >


The doc/perldoc/man command in the debugger is supposed to do something like
this:

$ perl -de0

Loading DB routines from perl5db.pl version 1.33
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(-e:1):   0
  DB<1> doc perlrules
No manual entry for perlrules


In 5.18.0 it does this:

$ ./perl -Ilib -de0

Loading DB routines from perl5db.pl version 1.39_09
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main::(-e:1):   0
  DB<1> doc perlrules
Undefined subroutine &DB::Obj::runman called at lib/perl5db.pl line 3698.
 at lib/perl5db.pl line 3698.
        DB::Obj::_handle_doc_command('DB::Obj=HASH(0x20d33d8)') called at lib/perl5db.pl line 3015
        DB::DB called at -e line 1
Debugged program terminated.  Use q to quit or R to restart,
use o inhibit_exit to avoid stopping after program termination,
h q, h R or h o to get additional info.
  DB<2> 


This is an error introduced by refactoring in commit c7b0c61d36b24841.

I've already pushed a fix with a test on the branch
smoke-me/nicholas/perl5db-perldoc


The fix is this:

@@ -3695,7 +3695,7 @@ sub _handle_doc_command {
     # man, perldoc, doc - show manual pages.
     if (my ($man_page)
         = $DB::cmd =~ /\A(?:man|(?:perl)?doc)\b(?:\s+([^(]*))?\z/) {
-        runman($man_page);
+        DB::runman($man_page);
         next CMD;
     }
 


The block of code was moved to a section of perl5db.pl which is in package
DB::Obj.

I've looked at the code and I don't think that there are any other similar
errors.


As this is a 5.18.0 regression the fix should be considered for backporting.

Nicholas Clark


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About