Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perl debugger masks new warnings - hard to find eval 166 #377

Closed
p5pRT opened this issue Aug 13, 1999 · 2 comments
Closed

perl debugger masks new warnings - hard to find eval 166 #377

p5pRT opened this issue Aug 13, 1999 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 13, 1999

Migrated from rt.perl.org#1212 (status was 'resolved')

Searchable as RT1212$

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 1999

From dcd@tc.fluke.com

I've been using a version of webget that I fetched quite a while ago,
but with this latest perl I'm getting new warnings.

I'll try to live with the new warnings but it is difficult to
fix them when the same warnings are not issued when the same
warnings are not printed from the debugger.
(I was going to try to trace to find the 'eval 166')

[ perhaps someone can suggest a way to find the line of
  source code where the eval'ed text came from ]

[ also, are we going to have to live with these new warnings - just curious ]

thanks for your ideas,
David Dyck

### the script normally runs with -w
dd​:dcd$ head -1 ~/bin/webget
#!/usr/local/bin/perl -w

### see the 2 warning lines with (eval 166) that are printed
### at the beginning of the program

dd​:dcd$ perl -w ~/bin/webget -f http​://fww/~dcd/
Operator or semicolon missing before &__inline__ at (eval 166) line 1.
Ambiguous use of & resolved as operator & at (eval 166) line 1.
GET /~dcd/ HTTP/1.0fww ...
waiting for data from fww ...
Server​: Netscape-Communications/1.1
Date​: Friday, 13-Aug-99 04​:22​:48 GMT
Last-modified​: Wednesday, 05-May-99 22​:11​:44 GMT
Content-length​: 2060
Content-type​: text/html

"~dcd" written (2060 bytes).

### but those lines don't get printed when running from the debugger

dd​:dcd$ perl -wd ~/bin/webget -f http​://fww/~dcd/

Loading DB routines from perl5db.pl version 1.0402
Emacs support available.

Enter h or `h h' for help.

main​::(/home/dcd/bin/webget​:8)​: $version = "961120.32";
  DB<1> c
GET /~dcd/ HTTP/1.0fww ...
waiting for data from fww ...
Server​: Netscape-Communications/1.1
Date​: Friday, 13-Aug-99 04​:22​:06 GMT
Last-modified​: Wednesday, 05-May-99 22​:11​:44 GMT
Content-length​: 2060
Content-type​: text/html

"~dcd" written (2060 bytes).
Debugged program terminated. Use q to quit or R to restart,
  use O inhibit_exit to avoid stopping after program termination,
  h q, h R or h O to get additional info.
  DB<1> q

Perl Info


Site configuration information for perl 5.00560:

Configured by dcd at Mon Aug  9 15:29:48 PDT 1999.

Summary of my perl5 (revision 5.0 version 5 subversion 60) configuration:
  Platform:
    osname=linux, osvers=2.2.10-ac12, archname=i686-linux
    uname='linux dd 2.2.10-ac12 #1 smp tue jul 20 13:44:40 pdt 1999 i686 '
    config_args='-Doptimize=-g'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
    use64bits=undef usemultiplicity=undef
  Compiler:
    cc='cc', optimize='-g', gccversion=2.7.2.1
    cppflags='-Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /shlib /lib /usr/lib
    libs=-lgdbm -ldbm -ldb -ldl -lm -lc
    libc=/lib/libc.so.5.4.44, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.00560:
    /usr/local/lib/perl5/5.00560/i686-linux
    /usr/local/lib/perl5/5.00560
    /usr/local/lib/site_perl/5.00560/i686-linux
    /usr/local/lib/site_perl
    .


Environment for perl 5.00560:
    HOME=/home/dcd
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/dcd/bin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/games:/usr/local/samba:/home/hobbes/tools/scripts:/home/hobbes/tools/linux:/usr0/hobbes/tools/scripts:/usr0/dcd/bin:/apps/general/bin:/usr/public
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 1999

From @tamias

On Thu, Aug 12, 1999 at 09​:29​:52PM -0700, David Dyck wrote​:

[ perhaps someone can suggest a way to find the line of
source code where the eval'ed text came from ]

Use a signal handler for warn that walks the caller stack​:

$SIG{__WARN__} =
  sub {
  warn @​_;
  my $i=0;
  my ($pack $file $line $subname $hasargs $wantarray);
  while (($pack,$file,$line,$subname,$hasargs,$wantarray)
  = caller($i++)) {
  print STDERR
  " WARN pack='$pack' file='$file' line='$line' ",
  "subname='$subname'\n";
  }
  }
;

Hope that helps!

Ronald

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant