develooper Front page | perl.perl5.porters | Postings from April 2003

Problem with Devel::Peek on Perl 5.8.0

Thread Next
From:
Steve Hay
Date:
April 15, 2003 09:42
Subject:
Problem with Devel::Peek on Perl 5.8.0
Message ID:
3E9C3696.60102@uk.radan.com
Hi,

I have a problem trying to use Devel::Peek under Perl 5.8.0 (built 
*with* PERL_MALLOC, in case you're wondering...).  The following 
one-liner used to work under Perl 5.6.1:

    perl -MDevel::Peek -e "mstat()"

but now outputs:

    Devel::Peek::mstat: : perl not compiled with DEBUGGING_MSTATS

I've traced the cause of this to ext/Devel/Peek.xs (line 130) which 
defines mstat() as dump_mstats() under the following conditions:

    #if (defined(PERL_DEBUGGING_MSTATS) || defined(DEBUGGING_MSTATS)) \
        && (defined(MYMALLOC) && !defined(PLAIN_MALLOC))

and makes it output the above message otherwise.

Under Perl 5.6.1, the corresponding section in Peek.xs is subtley different:

    #if defined(PERL_DEBUGGING_MSTATS) || defined(DEBUGGING_MSTATS) \
        || (defined(MYMALLOC) && !defined(PLAIN_MALLOC))

I don't know why this section was changed, but it has effectively 
disabled Devel::Peek::mstat() in Perl 5.8.0 since neither 
PERL_DEBUGGING_MSTATS nor DEBUGGING_MSTATS is actually defined when 
ext/Devel/Peek.c gets compiled.  (On my system, at least -- I'm running 
Windows XP with MSVC 6.)

I notice that malloc.c contains

    #ifndef PLAIN_MALLOC
    #  if defined(PERL_CORE) && !defined(DEBUGGING_MSTATS)
    #    define DEBUGGING_MSTATS
    #  endif
    #endif

but how is this setting of DEBUGGING_MSTATS supposed to work its way 
through to Devel/Peek?  The short answer, in my case, is that it doesn't.

Is there a reason why the conditions for defining mstat() in 
Devel/Peek.xs could not be put back how they were?  (Or, equivalently: 
Why was it changed in the first place?)

Steve


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