Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

perl debug

by RamiD (Acolyte)
on Jan 21, 2014 at 19:55 UTC ( [id://1071513]=perlquestion: print w/replies, xml ) Need Help??

RamiD has asked for the wisdom of the Perl Monks concerning the following question:

I have a problem , eclipse debug stop at

INIT { $global_phase++; foreach my $decl (@declarations) { _apply_handler_AH_($decl, 'INIT'); } }

in handler.pm , although I did not set a breakpoint there

my Env :

OS : windows 7

IDE =eclipse with EPIC 6

Active perl 5.14

also I had the errors in condole log

Loading DB routines from perl5db.pl version 1.33 Editor support available. Enter h or `h h' for help, or `perldoc perldebug' for more help. Attribute::Handlers::CODE(0x29912ec)(C:/Perl/lib/Attribute/Handlers.pm +:247): 247: $global_phase++; DB<1> printf $DB::OUT "%vd", $^V; 5.14.2 DB<2> print $DB::OUT eval { require PadWalker; PadWalker->VERSION(0. +08) } 1.96 DB<3> ;{ my $file = <<'EOT'; C:/testClass4/mlnx/Tmlnx/Helper/LinuxInstallImpl.pm EOT my $line = <<'EOT'; 27 EOT my $cond = ''; epic_breakpoints::add_breakpoint($file, $line, $cond); }; Undefined subroutine &epic_breakpoints::add_breakpoint called at (eval + 31)[C:/Perl/lib/perl5db.pl:640] line 11. DB<4> ;{ my $file = <<'EOT'; C:/testClass4/mlnx/Tmlnx/Helper/LinuxDevicePropertiesImpl.pm EOT my $line = <<'EOT'; 23 EOT my $cond = ''; epic_breakpoints::add_breakpoint($file, $line, $cond); }; Undefined subroutine &epic_breakpoints::add_breakpoint called at (eval + 32)[C:/Perl/lib/perl5db.pl:640] line 11. DB<5> . Attribute::Handlers::CODE(0x29912ec)(C:/Perl/lib/Attribute/Handlers.pm +:247): 247: $global_phase++; DB<6> T $ = Attribute::Handlers::INIT() called from file `C:/testClass4/mlnx/T +mlnx/Trun/IDeviceProperties.t' line 0 $ = eval {...} called from file `C:/testClass4/mlnx/Tmlnx/Trun/IDevice +Properties.t' line 0 DB<7> . Attribute::Handlers::CODE(0x29912ec)(C:/Perl/lib/Attribute/Handlers.pm +:247): 247: $global_phase++; DB<8> . Attribute::Handlers::CODE(0x29912ec)(C:/Perl/lib/Attribute/Handlers.pm +:247): 247: $global_phase++; DB<9> . Attribute::Handlers::CODE(0x29912ec)(C:/Perl/lib/Attribute/Handlers.pm +:247): 247: $global_phase++; DB<10> ;{ do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dump_lexical_vars; my $offset = 0; my $savout = CORE::select($DB::OUT); dumpvar_epic::dump_lexical_vars($offset); CORE::select($savout); }; 8|$builtin|1|1|17|SCALAR(0x1dd8934)|5|undef|1|5 13|$global_phase|1|1|17|SCALAR(0x2988a94)|3|'1'|1|3 8|$qual_id|1|1|17|SCALAR(0x299321c)|5|undef|1|5 14|%global_phases|1|1|15|HASH(0x299323c)|3|...|1|3 9|%lastattr|1|1|15|HASH(0x299325c)|3|...|1|3 6|%phase|1|1|15|HASH(0x2988264)|3|...|1|3 4|%raw|1|1|15|HASH(0x2988284)|3|...|1|3 6|%sigil|1|1|15|HASH(0x29889f4)|3|...|1|3 9|%symcache|1|1|15|HASH(0x299327c)|3|...|1|3 10|%validtype|1|1|15|HASH(0x299326c)|3|...|1|3 13|@declarations|1|1|16|ARRAY(0x2988964)|3|...|1|3 14|@global_phases|1|1|16|ARRAY(0x299322c)|3|...|1|3 DB<11> ;{ do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dump_lexical_vars; my $offset = 0; my $varexpr = <<'EOT'; $h->{'%global_phases'} EOT my $subref = \&dumpvar_epic::dump_hash_expr; my $savout = CORE::select($DB::OUT); my $savbuf = $|; $| = 0; $subref->($offset, $varexpr); $| = $savbuf; print ""; CORE::select($savout); }; DB<12> ;{ do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dump_lexical_vars; my $offset = 0; my $varexpr = <<'EOT'; $h->{'%global_phases'} EOT my $subref = \&dumpvar_epic::dump_hash_expr; my $savout = CORE::select($DB::OUT); my $savbuf = $|; $| = 0; $subref->($offset, $varexpr); $| = $savbuf; print ""; CORE::select($savout); }; DB<13> ;{ do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dump_lexical_vars; my $offset = 0; my $varexpr = <<'EOT'; $h->{'%lastattr'} EOT my $subref = \&dumpvar_epic::dump_hash_expr; my $savout = CORE::select($DB::OUT); my $savbuf = $|; $| = 0; $subref->($offset, $varexpr); $| = $savbuf; print ""; CORE::select($savout); }; DB<14> ;{ do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dump_lexical_vars; my $offset = 0; my $varexpr = <<'EOT'; $h->{'%lastattr'} EOT my $subref = \&dumpvar_epic::dump_hash_expr; my $savout = CORE::select($DB::OUT); my $savbuf = $|; $| = 0; $subref->($offset, $varexpr); $| = $savbuf; print ""; CORE::select($savout); }; DB<15>
any advice

Replies are listed 'Best First'.
Re: perl debug (EPIC vs Attribute::Handlers)
by LanX (Saint) on Jan 21, 2014 at 20:30 UTC
    With which commands did you produce the "errors" in the console? What did you type?

    This multiline-output

     <13> ;{ ... looks unusual!

    > any advice

    Please try reproducing thsi problem by direct debugging from the console with perl -d file.pl and tell us if you still have problems.

    I think epic's way to adapt the debugger (in dumpvar_epic.pm ) for it's needs has a conflict with Attribute::Handlers .

    If so please report a bug at epic maintainers.

    edit

    Alternatively at p5p, AFAIR (and for reasons which are beyond my understanding) does dumpvar.pm reside in main. Damian's way to inspect the STASH for subs having an attribute might conflict!

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      it's working now

      I don't know what exactly did to make it work but I will write it any way

      some of the steps I found in fourms all over th einternet

      1-)install PathTools

      2-) look for CWD.pm in all perl directory , in my env the CWD.pm is in more than one place , so I did commit the fix in all CWD.pmway

      3-)upgrade Attribute handlers

      4-) maybe we should run per makefile.pl

      and make

      thanks

        > I don't know what to add in DB<1>

        type c + RETURN for "continue". The debugger doesn't run automatically.

        type h for help.

        see also perldebug and perldebtut

        > what I did so far is download the Test::Class project and

        > trying to work with it via eclipse,epic

        yeah two things I don't use, sorry.

        I can see from the docs that Test::Class uses attributes, that's all I can say.

        And regarding EPIC ... well you should know that Eclipse is by far not as important in Perl programming as in the Java context.

        I won't install it now to track down the problem ... which ATM looks like a bug for me.

        So if you don't wanna workaround it by replacing either Test::Class or Eclipse, you should post a smallest possible chunk of code to reproduce the problem and hope that someone with a similar work environment can track down the problem.

        If it's positively a bug you should inform the maintainers of EPIC and Test::Class.

        HTH! =)

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Re: perl debug
by pemungkah (Priest) on Jan 23, 2014 at 06:21 UTC
    The trick is to return from the INIT routine, which will put you at the first executable line of your test. In the debugger, that's an r commamd. Maybe "step out" in Eclipse?

    You should then set any breakpoints you want in the specific test subs then c to continue (or whatever Eclipse's equivalent of "run from here to the next breakpoint" is). Otherwise be prepared to step your way through a lot of code you don't care about until you reach the call that actually executes your code somewhere in the bowels of Test::Class.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1071513]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found