Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Perl debugging issue

by manorhce (Beadle)
on Feb 05, 2013 at 12:46 UTC ( #1017147=perlquestion: print w/ replies, xml ) Need Help??
manorhce has asked for the wisdom of the Perl Monks concerning the following question:

Hi I am new to perl debug debugging the perl code with perl -d but getting error like "Line 16 not breakable" my point is on what conditions it will say "Line <some no> not breakable"

Comment on Perl debugging issue
Replies are listed 'Best First'.
Re: Perl debugging issue (line not breakable)
by LanX (Canon) on Feb 05, 2013 at 12:52 UTC
    We need more infos what you did!

    Did you manually try to set a breakpoint? Maybe in a BEGIN-block?

    If not, do you have any debugger code in your script?

    Try grepping for things starting with "DB::"

    Cheers Rolf

    UPDATE

    Not every source line results in an atomic step at run-time where you can set a breakpoint.

    e.g.

    • Many lines are grouped together into one step.
    • They were only relevant at compile-time.
    • Were NOPs (no-operations) like empty lines or comments
    • ...

    See the following snippet from "Programming Perl" for examples:

    To look at a "window" of source code around the breakpoint, use the w command:

    DB<2> w 5 } 6 7 sub infested { 8==>b my $bugs = int rand(3); 9: our $Master; 10: contaminate($Master); 11: warn "needs wash" 12 if $Master && $Master->isa("Human"); 13 14: print "got $bugs\n"; DB<2>

    As you see by the ==> marker, your current line is line 8, and by the b there, you know it has a breakpoint on it. If you had set an action, there also would also have been an a there. The line numbers with colons are breakable; the rest are not.

Re: Perl debugging issue
by manorhce (Beadle) on Feb 05, 2013 at 13:06 UTC

    I am trying to print the value what it is getting after some line my code is purely simple

    $ENV{DENALI_ROOT}=rel2abs($ENV{DENALI_ROOT}); my @dirs=splitdir(canonpath($ENV{DENALI_ROOT}); print Dumper(@dirs); #print $RealBin;

    I want to print $ENV{DENALI_ROOT} through perl debugger.Yes I ran it manually like perl -d <my file name>

      but my point is when we will get the issue like "line is not breakable"

Re: Perl debugging issue
by manorhce (Beadle) on Feb 05, 2013 at 13:15 UTC

    got it Thanks

Re: Perl debugging issue
by vinoth.ree (Prior) on Feb 06, 2013 at 03:48 UTC

    Update:

    Oops...Sorry LanX already pointing this Link

    Removed the link.

      No, I wouldn't link to a pirate copy of a book.

      Please don't do this!

      Cheers Rolf

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (17)
As of 2015-07-07 21:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls