$LINEINFO undefined in &DB::DB when using noTTY mode 
Author Message
 $LINEINFO undefined in &DB::DB when using noTTY mode

I want to be able to debug my CGI scripts while they are actually
running as CGI scripts so I'm trying to use the Term::Rendezvous
mechanism described in perldebug.  

BTW: The documentation implies that there's a standard Term::Rendezvous
that I can use if I don't want to roll my own but I can't find it!

The problem I'm finding is that when my program does $DB::single=1
then &DB::DB tries to print line-info to filehandle $LINEINFO _before_
it calls &setterm to setup the file handles $IN, $OUT and $LINEINFO.

I'm currently working arround this by putting "LineInfo=/dev/null" in
my $ENV{PERLDB_OPTS} and undef($DB::LINEINFO) in my
&Term::Rendezvous::new.  This is still not perfect because it means
that I don't see the line-info at the breakpoint.

Am I missing something here or is this a bug in the de{*filter*}?

FYI here's my Term::Rendezvous:

package Term::Rendezvous;
use strict;
use warnings;

sub new {
    my $class = shift;
    my $fifo_name = shift or die;
    open (my $fifo,'<',$fifo_name) or die "Cannot open $fifo_name: $!";
    defined(my $tty_name = <$fifo>) or die;
    chomp $tty_name;
    open (my $tty,'+<',$tty_name) or die "Cannot open $tty_name: $!";
    undef $DB::LINEINFO; # This should not be needed
    bless \$tty, $class;

Quote:
}

sub IN { ${+shift} }
*OUT = \&IN;

1;
__END__

--
     \\   ( )
  .  _\\__[oo

 .  l___\\
  # ll  l\\
 ###LL  LL\\



Sat, 24 Apr 2004 22:51:41 GMT  
 $LINEINFO undefined in &DB::DB when using noTTY mode
[A complimentary Cc of this posting was sent to

Quote:
> BTW: The documentation implies that there's a standard Term::Rendezvous

No it does not.

Quote:
> that I can use if I don't want to roll my own but I can't find it!

*If* the module of this name can be loaded, it is used.  If you can
 create a portable one, feel free to release it.

Quote:
> The problem I'm finding is that when my program does $DB::single=1
> then &DB::DB tries to print line-info to filehandle $LINEINFO _before_
> it calls &setterm to setup the file handles $IN, $OUT and $LINEINFO.

This is bad indeed...  Is perl-current still demonstrating this?  In
summer I changed the code to print lineinfo to better support forking,
but I do not know whether it saves rendezvouing too...

Quote:
> I'm currently working arround this by putting "LineInfo=/dev/null" in
> my $ENV{PERLDB_OPTS} and undef($DB::LINEINFO) in my
> &Term::Rendezvous::new.  This is still not perfect because it means
> that I don't see the line-info at the breakpoint.

You need another workaround: reset LineInfo back when you set the TTY up.

Ilya



Mon, 26 Apr 2004 05:56:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Web sites for freeware, shareware delphi components/utilities

2. swapping to disk/ems/xms/etc

3. Undefined subroutine "DB"

4. Perl 5.0005_02 fails "make test", db-btree and db-hash tests

5. DB_File 1.71 / Berkly DB Hash and sendmail /etc/aliases.db

6. Berkeley DB, DB File on multiple platforms

7. Berkeley DB / DB File Concurrence Problem

8. DB failures on DEC Alpha if DB created elsewhere

9. Berkeley DB / DB File Concurrence Problem

10. DB failures on DEC Alpha if DB created elsewhere

11. flat file db Vs Aliases.db by Perl.

12. Can Perl read DB (.db) format files?

 

 
Powered by phpBB® Forum Software