Variables do not appear during debugging

jasondwilliams wrote on Tue Sep  2 20:22:03 MEST 2008:
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> 
jploski wrote on Tue Sep  2 20:34:34 MEST 2008:
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
jasondwilliams wrote on Tue Sep  2 21:20:44 MEST 2008:
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!
jploski wrote on Tue Sep  2 21:25:19 MEST 2008:
Another possibility is that you are using gcj - in which case you should
switch to Sun's implementation of Java.
jasondwilliams wrote on Tue Sep  2 21:55:49 MEST 2008:
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
jploski wrote on Tue Sep  2 22:23:03 MEST 2008:
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.
jasondwilliams wrote on Wed Sep  3 17:57:31 MEST 2008:
Re: Performance: good point - I've noticed the improvement already.  

Great work with EPIC - really nice s/w!  

Thanks!
- Jason
pierresource wrote on Tue Oct  7 16:27:46 MEST 2008:
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
henderm983 wrote on Wed Oct  8 06:04:45 MEST 2008:
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.
pierresource wrote on Wed Oct  8 14:33:18 MEST 2008:
Hi Matthew,

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

Thanks!

Pierre
jploski wrote on Sun Oct 26 15:20:59 CET 2008:
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.
g_simpson wrote on Fri Oct 31 00:24:50 CET 2008:
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
g_simpson wrote on Fri Oct 31 17:17:16 CET 2008:
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
jploski wrote on Fri Oct 31 18:41:53 CET 2008:
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).

Note: The above is an archived snapshot of a forum thread. Use the original thread at sf.net to post comments.