Tolgar
asked on
How to debug into sub functions in Perl?
Hi,
I have subfunction in my code and Perl debugger cannot go into it.
Here is what I do:
It stops at linenumber and when I say step into it it skips. n also does not work.
Here is the beginning of my sub function:
How can I debug this code?
I have subfunction in my code and Perl debugger cannot go into it.
Here is what I do:
perl -d myFile
b linenumber
c
s
It stops at linenumber and when I say step into it it skips. n also does not work.
Here is the beginning of my sub function:
SOME CODE
my (%c, %d);
sub logFunc {
my ($a, $b) = @_;
my $S;
my $file;
SOME OTHER CODE
} #myFunc
SOME MORE CODE
How can I debug this code?
n runs until the next statement (the one immediately following this one in the current file) is about to execute. Note that if the current line is a subroutine call, the debugger won't stop until returning from that subroutine. To stop at the first line of the called subroutine, use the s (single-step) command instead. The r command executes until returning from the current subroutine (i.e., until we pop the activation stack).
ASKER
Well, I already use s but it still does not go into the subroutine. Why is that?
Thanks,
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.