develooper Front page | perl.perl5.porters | Postings from October 1999

Re: [ID 19991029.007] Debugger: Break gets set on wrong subroutine

Thread Previous
Ilya Zakharevich
October 29, 1999 14:45
Re: [ID 19991029.007] Debugger: Break gets set on wrong subroutine
Message ID:
Tye McQueen writes:
> Requesting a break point on a subroutine can actually set a break
> point on a different subroutine.  It appears that the debugger
> assumes that the first executable line of a subroutine will be
> the line that is executed first, but this isn't always the case:
>     sub problem {
> 	$SIG{__DIE__}= sub {
> 	    die "<b problem> will set a break point here.\n";
> 	};	# The break point _should_ be set here.
> 	warn "This line will run even if you enter <c problem>.\n";
>     }
>     &problem;
> Perhaps the debugger can skip the first executable lines if they
> belong to a different subroutine?  Or perhaps the parse tree gives
> a clue to the execution order?  Or perhaps the parser can insert a
> no-op node at the start of subs compiled for the debugger?

There are many other related problems.

My solution would be to put breaks on *all* the OP_DBSTATEs (sp?) which
appear on a given line.  Currently the break is put on the *last*

This will need to keep a linked list of DBSTATEs per line number,
instead of one stored DBSTATE per line number which we have now.  Any


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About