Variables do not appear during debugging

Help
2008-09-02
2013-05-20
  • Jason Williams

    Jason Williams - 2008-09-02

    I have installed EPIC and PadWalker with no complaints.  I can step through code as expected.  However when I run any Perl program, no variables are displayed in the "Variables" tab. 

    I have enabled the EPIC debugger console and I can see that there are errors (see below), but I don't know what to do.  Any advice?

    Config:
    - Ubuntu 8.04
    - Eclipse 3.2.2
    - EPIC (up-to-date as of today via Help->Software updates...)
    - PadWalker 1.7

    My Perl program:

      my $i="Hello World\n";
      print $i;

    Output from the debugger console:

    Loading DB routines from perl5db.pl version 1.28
    Editor support available.

    Enter h or `h h' for help, or `man perldebug' for more help.

    main::(/home/jdw/workspace/HelloPerl/HelloPerl.pl:1):
    1:    my $i="Hello World\n";
      DB<1> printf $DB::OUT "%vd", $^V;
    5.8.8
      DB<2> .
    main::(/home/jdw/workspace/HelloPerl/HelloPerl.pl:1):
    1:    my $i="Hello World\n";
      DB<2> T
      DB<2> .
    main::(/home/jdw/workspace/HelloPerl/HelloPerl.pl:1):
    1:    my $i="Hello World\n";
      DB<2> ;{
        if (eval { require PadWalker; PadWalker->VERSION(0.08) })
        {
            do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dump_lexical_vars;

            defined &dumpvar_epic::dump_lexical_vars
                or print $DB::OUT "dumpvar_epic.pm not available.\n";

            my $savout = select($DB::OUT);
            dumpvar_epic::dump_lexical_vars();
            select($savout);
        }
        else
        {
            print $DB::OUT "PadWalker module not found - please install\n";       
        }
    };

    Missing right curly or square bracket at (eval 9)[/usr/share/perl/5.8/perl5db.pl:628] line 9, at end of line
    syntax error at (eval 9)[/usr/share/perl/5.8/perl5db.pl:628] line 9, at EOF

      DB<3> ;{
        do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dump_package_vars;

        defined &dumpvar_epic::dump_package_vars
            or print $DB::OUT "dumpvar_epic.pm not available.\n";
           
        my $savout = select($DB::OUT);
        dumpvar_epic::dump_package_vars();
        select($savout);
    };

    syntax error at (eval 10)[/usr/share/perl/5.8/perl5db.pl:628] line 2, near ";
    or"

      DB<4>

     
    • Jan Ploski

      Jan Ploski - 2008-09-02

      Possibly a broken version of perl5db.pl in your system. Search back in this forum and you will find plenty of discussion about the "Missing right curly", including one that culimnated in a patch to perl5db.pl

       
    • Jason Williams

      Jason Williams - 2008-09-02

      I searched and the patch I believe you're referring to is in the call to recv, here:

        http://sourceforge.net/forum/message.php?msg_id=3810146

      It looks like my perl5db.pl has already been patched; the relevant section of code (line 6356) looks like this:

              # Receive anything there is to receive.
              $stuff;
              my $stuff = '';
              my $buf;
              do {
                  $IN->recv( $buf = '', 2048 );   # XXX "what's wrong with sysread?"
                                                  # XXX Don't know. You tell me.
              } while length $buf and ($stuff .= $buf) !~ /\n/;

              # What we got.
              $stuff;

      Any further pointers?  Thanks!

       
      • Jan Ploski

        Jan Ploski - 2008-09-02

        Another possibility is that you are using gcj - in which case you should switch to Sun's implementation of Java.

         
    • Jason Williams

      Jason Williams - 2008-09-02

      Installing Sun Java fixes the problem.  The variable display is superb -- thanks!

      It's worth noting that Ubuntu installs with gcj, that Eclipse and EPIC install without complaint, and that EPIC otherwise works as expected with gcj.  Perhaps I am unusual in using Eclipse on Ubuntu and unusual in encountering this issues... but it might be worth adding the sun java requirement to the manual and download page, right next to the PadWalker requirement. 

      Thanks again!
      - Jason

       
      • Jan Ploski

        Jan Ploski - 2008-09-02

        I added a warning about gcj to the system requirements section of the FAQ.

        Strictly speaking, gcj's behavior regarding buffered IO is probably not a bug. It's more that perl5db.pl relies on unspecified behavior and is biased towards interactive debugging, where it is more likely that a single buffer will contain the entire command.

        There is another good reason not to use gcj - performance (or lack thereof). Opening large Perl source files in the editor is orders of magnitude faster using Sun's Java than it is with gcj.

         
    • Jason Williams

      Jason Williams - 2008-09-03

      Re: Performance: good point - I've noticed the improvement already. 

      Great work with EPIC - really nice s/w! 

      Thanks!
      - Jason

       
    • Pierre Racine

      Pierre Racine - 2008-10-07

      Hi,

      I also can't see the variables. I have:

      -Windows XP
      -Eclipse 3.3.2
      -EPIC 0.6.25
      -PadWalker 1.7
      -ActivePerl 5.10.0.1004-MSWin32-x86-287188
      -Sun Java 6

      Pierre

       
    • Matthew Henderson

      Pierre,

          Have you made sure that you have choosen to view global and local variables in the variable view menu?  These are not choosen initially and threw me for a loop at first.

       
    • Pierre Racine

      Pierre Racine - 2008-10-08

      Hi Matthew,

      This did the trick. Seems to me that these options should be checked by default... Maybe they were...

      Thanks!

      Pierre

       
      • Jan Ploski

        Jan Ploski - 2008-10-26

        There was also a bug in 0.6.25 which caused global variables to be displayed "empty" (arrays and hashes) when the "Show Local (!) Variables" option was not enabled. Upgrade to 0.6.26 to avoid this potential problem. An additional benefit is that you can also see 'our' variables in 0.6.26.

         
    • Gary Simpson

      Gary Simpson - 2008-10-30

      Hello,

      I also can't see the variables.  I have nothing whatsoever appearing in the Variables View:  no variables, no configuration menu, nothing but eternally empty columns.

      I have:

      -Windows XP SP2
      -Eclipse SDK 3.4.1 build M20080911-1700
      -EPIC 0.6.27 (EPIC external libs Plug-in 0.6.1)
      -PadWalker 1.7
      -ActivePerl 5.10.0.1004-MSWin32-x86-287188

      Thanks for any ideas,
      Gary

       
      • Gary Simpson

        Gary Simpson - 2008-10-31

        I seem to have solved my own problem.  I needed to declare at least one "my" variable.  Otherwise the options "Show Perl Internal Variables", etc., in the Variable View menu all remained grayed out.  Now that I have selected those, they remain selected even if I remove all "my" variables.

        Thanks,
        Gary

         
        • Jan Ploski

          Jan Ploski - 2008-10-31

          There is no causal link between your editing the file and the options ceasing to be grayed out. They become enabled after you start debugger for the first time in an Eclipse session (unfortunately there's no way to make them enabled right from the beginning).

           
  • Anonymous - 2012-11-12

    I am having the exact same problem. I am using cygwin perl (-v reveals: "perl 5, version 14, subversion 2 (v5.14.2)") on Windows 7 & Java 6u37 but the variables display remains empty (or actually: it is not empty but contains ONE entry right from the start "$^RE_TRIE_MAXBUF  65536" (whatever that is, its NOT a variable in my program, that's for sure…) and that display never changes.

    I have all three menu options (perl internal, global and local variables)  enabled but changing any of these didn't make a difference.

    @g_simpson: what excactly did you mean with 'one of "my" variable'? What is a "my" variable?

    Michael

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks