Skip Menu |
Report information
Id: 131672
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: kes-kes [at] yandex.ru
Cc:
AdminCc:

Operating System: Linux
PatchStatus: (no value)
Severity: low
Type: docs
Perl Version: 5.24.1
Fixed In: (no value)



Date: Wed, 28 Jun 2017 23:27:44 +0300
From: KES <kes-kes [...] yandex.ru>
To: perlbug <perlbug [...] perl.org>
Subject: perldebguts documentation should be fixed
Download (untitled) / with headers
text/plain 5.4k
Subject: perldebguts documentation should be fixed To: perlbug@perl.org Reply-To: kes-kes@yandex.ru Cc: kes-kes@yandex.ru Message-Id: <5.24.1_12623_1498681035@kes-X751SA> From: kes-kes@yandex.ru This is a bug report for perl from kes-kes@yandex.ru, generated with the help of perlbug 1.40 running under perl 5.24.1. ----------------------------------------------------------------- [Please describe your issue here] [The documentation](https://perldoc.perl.org/perldebguts.html) should be fixed: --- (This doesn't happen if the subroutine was compiled in the DB package.) +++ (This doesn't happen if the subroutine was called from DB package.) In short: Despite on 'from_db' sub is compiled at main:: package we do NOT see calls to 'DB::sub' for it Becase CALL to this sub is made from DB:: package And vice versa: Despite on 'DB::test' is compiled at DB:: package we see calls to 'DB::sub' for it Becase CALL to this sub is made not from DB:: package The output: $ perl -Ilib -d:DB test.pl Called: main::BEGIN Called: DB::test $cat test.pl sub from_db {}; use Test; DB::test(); $cat lib/Test.pm package Test; 1; $cat lib/Devel/DB.pm package DB; use B qw/ svref_2object /; sub sub_name { my $r = shift; return $r unless ref $r; return $r unless my $cv = svref_2object( $r ); return $r unless $cv->isa( 'B::CV' ) and my $gv = $cv->GV ; my $name = ''; if ( my $st = $gv->STASH ) { $name = $st->NAME . '::'; } my $n = $gv->NAME; if ( $n ) { $name .= $n; if ( $n eq '__ANON__' ) { $name .= ' defined at ' . $gv->FILE . ':' . $gv->LINE; } } return $name; } sub test{}; sub postponed { # Call only after DB:: is loaded main::from_db() if shift ne '*main::_<lib/Devel/DB.pm'; } sub DB{ main::from_db(); } sub sub { print "Called: ", sub_name( $DB::sub ), "\n"; main::from_db(); &$DB::sub; } 1; See attached archive with source codes. [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=docs severity=low --- Site configuration information for perl 5.24.1: Configured by kes at Sun Apr 30 22:40:30 EEST 2017. Summary of my perl5 (revision 5 version 24 subversion 1) configuration: Platform: osname=linux, osvers=4.4.0-53-generic, archname=x86_64-linux uname='linux kes-x751sa 4.4.0-53-generic #74-ubuntu smp fri dec 2 15:59:10 utc 2016 x86_64 x86_64 x86_64 gnulinux ' config_args='-de -Dprefix=/home/kes/perl5/perlbrew/perls/perl-5.24.1 -Aeval:scriptdir=/home/kes/perl5/perlbrew/perls/perl-5.24.1/bin' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='', gccversion='5.4.0 20160609', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.23.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.23' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' Locally applied patches: Devel::PatchPerl 1.38 --- @INC for perl 5.24.1: /home/kes/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/x86_64-linux /home/kes/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1 /home/kes/perl5/perlbrew/perls/perl-5.24.1/lib/5.24.1/x86_64-linux /home/kes/perl5/perlbrew/perls/perl-5.24.1/lib/5.24.1 --- Environment for perl 5.24.1: HOME=/home/kes LANG=en_US.UTF-8 LANGUAGE=en LC_ADDRESS=uk_UA.UTF-8 LC_IDENTIFICATION=uk_UA.UTF-8 LC_MEASUREMENT=uk_UA.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_MONETARY=uk_UA.UTF-8 LC_NAME=uk_UA.UTF-8 LC_NUMERIC=uk_UA.UTF-8 LC_PAPER=uk_UA.UTF-8 LC_TELEPHONE=uk_UA.UTF-8 LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/kes/perl5/perlbrew/bin:/home/kes/perl5/perlbrew/perls/perl-5.24.1/bin:/home/kes/bin:/home/kes/bin:/home/kes/bin:/home/kes/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PERLBREW=command perlbrew PERLBREW_BASHRC_VERSION=0.78 PERLBREW_HOME=/home/kes/.perlbrew PERLBREW_MANPATH=/home/kes/perl5/perlbrew/perls/perl-5.24.1/man PERLBREW_PATH=/home/kes/perl5/perlbrew/bin:/home/kes/perl5/perlbrew/perls/perl-5.24.1/bin PERLBREW_PERL=perl-5.24.1 PERLBREW_ROOT=/home/kes/perl5/perlbrew PERLBREW_VERSION=0.78 PERL_BADLANG (unset) SHELL=/bin/bash
Download bugreport.tar
application/x-tar 10k

Message body not shown because it is not plain text.

Subject: Re: [perl #131672] perldebguts documentation should be fixed
To: perl5-porters [...] perl.org
Date: Thu, 29 Jun 2017 09:21:04 +0100
From: Zefram <zefram [...] fysh.org>
Download (untitled) / with headers
text/plain 399b
KES wrote: Show quoted text
>--- (This doesn't happen if the subroutine was compiled in the DB package.) >+++ (This doesn't happen if the subroutine was called from DB package.)
The phrase "the subroutine" is ambiguous, because in that paragraph there are two subroutines in play. The original could be clarified by expanding to "the calling subroutine". Your proposed change would retain the ambiguity. -zefram
To: "perlbug-followup [...] perl.org" <perlbug-followup [...] perl.org>
Subject: Re: [perl #131672] perldebguts documentation should be fixed
From: KES <kes-kes [...] yandex.ru>
Date: Sat, 08 Jul 2017 20:21:50 +0300
Download (untitled) / with headers
text/plain 1.1k
Show quoted text
> KES wrote:
>> --- (This doesn't happen if the subroutine was compiled in the DB package.) >> +++ (This doesn't happen if the subroutine was called from DB package.)
Actually first is right. Because with current behavior: when a call to &DB::sub is not happen if the subroutine was called from DB package I can not setup breakpoint by subroutine name. I check $DB::sub and setup breakpoint at 'DB::sub'. Code looks like next: if( $breakpoints{ $DB::sub } ) { $DB::single = 1 }; This works well in most cases except for next one. I implement debugger command in not DB package. I do this because want to be able to debug debugger command. So when that subroutine (which implements debugger command) is called from DB package, it can not be tracked. A call to &DB::sub is not happen As work around I put next code into that sub: $^D |= (1<<30); $DB::single = 1; But this will not be required if perl works as documented: A call to &DB::sub is happened for all subroutines which was not compiled in the DB package. despite on place of call. I check this behavior on the oldest version I have: perl-5.6.2 it works contrary to the documentation too =(
From: Zefram <zefram [...] fysh.org>
Subject: Re: [perl #131672] perldebguts documentation should be fixed
To: perl5-porters [...] perl.org
Date: Tue, 5 Dec 2017 18:11:42 +0000
Documentation fixed in commit 7270698f29ae2f22f2cdfec7b156a75602cddf68. -zefram
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 483b
On Tue, 05 Dec 2017 10:11:53 -0800, zefram@fysh.org wrote: Show quoted text
> Documentation fixed in commit 7270698f29ae2f22f2cdfec7b156a75602cddf68. > > -zefram
Thank you for fix. Zefram, will next sound more clear? Please review. When execution of the program reaches a subroutine call, a call to &DB::sub (args) is made instead, with $DB::sub holding the name of the called subroutine. (This happen for all debuggable subroutines. Subroutines compiled in DB:: package all are not debuggable.)
From: Zefram <zefram [...] fysh.org>
Date: Wed, 17 Jan 2018 23:11:39 +0000
Subject: Re: [perl #131672] perldebguts documentation should be fixed
To: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 183b
KES via RT wrote: Show quoted text
>Zefram, will next sound more clear?
No, that's less clear. If you want to raise another issue with the documentation, please do so in a separate ticket. -zefram
Download (untitled) / with headers
text/plain 317b
Thank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been resolved. Perl 5.28.0 may be downloaded via: https://metacpan.org/release/XSAWYERX/perl-5.28.0 If you find that the problem persists, feel free to reopen this ticket.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org