This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #118817] avoid using 2 handles to write to the debug output
authorTony Cook <tony@develop-help.com>
Mon, 13 Jan 2014 22:24:40 +0000 (09:24 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 14 Jan 2014 21:38:21 +0000 (08:38 +1100)
commit24fc4d43fd764bf7c5e014625749cdd1af8475a8
treee7b6375ce7b36bb498383b7aac185a0dbb2d379e
parent1349b9be40d2d31fbcb7f256cffa12b5772bd327
[perl #118817] avoid using 2 handles to write to the debug output

Previously the tests were run with the following config:

  NonStop=0 TTY=db.out LineInfo=db.out

This meant that the debugger would write the prologue, command prompts
and their results and the epilogue to one handle, and any line trace
information to the second handle.  Since those handles didn't share a
file position, the line trace info would overwrite the prologue, and
the epilogue would overwrite part of the line trace info.

When TTY=vt100 on Redhat systems this made the epilogue just long
enough to overwrite the line trace data that a test matched against,
causing the test to fail.

To fix this, I avoided setting LineInfo:

  NonStop=0 TTY=db.out

and since LineInfo defaults to using the TTY handle, both types of
content are written to db.out *without* overwriting each other.

Unfortunately this broke some other tests, since the command prompts
which were overwritten by line trace information are now mixed in with
the line traces - I've modified the tests that failed to account for
the included command lines.
lib/perl5db.t