Error Parsing Debugger Variables

seitfa wrote on Mon Jul  3 00:18:16 MEST 2006:
Hi,

I always get an error when I try to debug a perl-program (when pressing
the debug-button)

My system:

eclipse 3.1.2
eplic-dev, June 26
perl 5.8.7
padwalker 0.10

Here are the details of the error:

Error Parsing Debugger Variables
  *******************************
  *******************************
  +++++++Error Parsing Vars++++++
  *******************************
  *******************************
  Missing right curly or square bracket at (eval 9)[/usr/share/perl/5.8/perl5db.pl:628]
line 4, at end of line
  syntax error at (eval 9)[/usr/share/perl/5.8/perl5db.pl:628] line 4, at
EOF
  -------------------------------
  -------------------------------
  +++++++Error Parsing Vars++++++
  -------------------------------
  -------------------------------
  java.lang.Exception: *******************************
  *******************************
  +++++++Error Parsing Vars++++++
  *******************************
  *******************************
  Missing right curly or square bracket at (eval 9)[/usr/share/perl/5.8/perl5db.pl:628]
line 4, at end of line
  syntax error at (eval 9)[/usr/share/perl/5.8/perl5db.pl:628] line 4, at
EOF
  -------------------------------
  -------------------------------
  +++++++Error Parsing Vars++++++
  -------------------------------
  -------------------------------
     at org.epic.debug.varparser.TokenVarParser.logParsError(TokenVarParser.java:254)
     at org.epic.debug.varparser.TokenVarParser.parseVars(TokenVarParser.java:65)
     at org.epic.debug.varparser.TokenVarParser.parseVars(TokenVarParser.java:40)
     at org.epic.debug.PerlDB.setVarList(PerlDB.java:1217)
     at org.epic.debug.PerlDB.access$3(PerlDB.java:1209)
     at org.epic.debug.PerlDB$VarUpdateJob.runInUIThread(PerlDB.java:1603)
     at org.eclipse.ui.progress.UIJob$1.run(org.eclipse.ui.workbench_3.1.2.jar.so)
     at org.eclipse.swt.widgets.RunnableLock.run(org.eclipse.swt.gtk.linux.x86_3.1.1.jar.so)
     at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(org.eclipse.swt.gtk.linux.x86_3.1.1.jar.so)
     at org.eclipse.swt.widgets.Display.runAsyncMessages(org.eclipse.swt.gtk.linux.x86_3.1.1.jar.so)
     at org.eclipse.swt.widgets.Display.readAndDispatch(org.eclipse.swt.gtk.linux.x86_3.1.1.jar.so)
     at org.eclipse.ui.internal.Workbench.runEventLoop(org.eclipse.ui.workbench_3.1.2.jar.so)
     at org.eclipse.ui.internal.Workbench.runUI(org.eclipse.ui.workbench_3.1.2.jar.so)
     at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org.eclipse.ui.workbench_3.1.2.jar.so)
     at org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse.ui.workbench_3.1.2.jar.so)
     at org.eclipse.ui.internal.ide.IDEApplication.run(org.eclipse.ui.ide_3.1.1.jar.so)
     at org.eclipse.core.internal.runtime.PlatformActivator$1.run(org.eclipse.core.runtime_3.1.2.jar.so)
     at org.eclipse.core.runtime.adaptor.EclipseStarter.run(org.eclipse.osgi_3.1.2.jar.so)
     at org.eclipse.core.runtime.adaptor.EclipseStarter.run(org.eclipse.osgi_3.1.2.jar.so)
     at java.lang.reflect.Method.in



Any idea?

Thanks for your help

     Fabian Seither


jploski wrote on Mon Jul  3 01:06:56 MEST 2006:
Does it happen for all code you are trying to debug or for some specific
code?
seitfa wrote on Mon Jul  3 12:37:39 MEST 2006:
It happens with all code, even with a simple "print "test";".
jploski wrote on Mon Jul  3 19:05:51 MEST 2006:
Does debugging using the command-line debugger (perl -d) work as expected?
seitfa wrote on Tue Jul  4 17:46:56 MEST 2006:
Yes is works as expected:

seitfa@notebook:~/workspace/test$ cat test.pl
my $test = "hallo";
my $test2 = "2";

seitfa@notebook:~/workspace/test$ cat test.pl
my $test = "hallo";
my $test2 = "2";

print $test;
seitfa@notebook:~/workspace/test$ perl -d test.pl

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::(test.pl:1):      my $test = "hallo";
  DB<1> n
main::(test.pl:2):      my $test2 = "2";
  DB<1> n
main::(test.pl:4):      print $test;
  DB<1> x $test
0  'hallo'
  DB<2> x $test2
0  2
  DB<3> q
jploski wrote on Tue Jul  4 21:18:57 MEST 2006:
If you download and install today's version of epic-devel, you will find
a new preference "Enable debugger console" on the Perl EPIC preferences
page. When you check it and start debugging, some additional information
will be provided which might help you diagnose the fault:

1. The invocation of perl -d used by EPIC will be written to the "Error
Log".
2. The "Debug" view will contain a new item labeled "perl -d". When you
click on it, the "Console" view will be updated to show the interactions
which take place between EPIC and perl -d: red text are commands sent by
EPIC, black text are responses (they appear quite cryptic).

The idea is that with this information you might be able to reproduce the
EPIC problem using a standalone perl -d session - feed the commands manually.
Then you might find out which command causes the wrong response and why.
I think that you might have to examine dumpvar_epic.pm, which is a helper
script executed by EPIC via perl -d to obtain values of variables (you will
see these invocations in the Console view).
seitfa wrote on Wed Jul  5 16:33:20 MEST 2006:
Hi,

ich tried what you said, hiere is the output of perl -d (in eclipse):

T

  DB<5> .

main::(/home/seitfa/workspace/epic_test/test.pl:1):
1:	my $test = "hallo";
  DB<6> .

main::(/home/seitfa/workspace/epic_test/test.pl:1):
1:	my $test = "hallo";
  DB<7> o frame=0


               frame = '0'
  DB<8> ;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpvar_epic::dumpvar_epic
or print $DB::OUT "dumpvar_epic.pl not available.\n";my $h = eval { PadWalker::peek_my(2)
};my @vars = split (' ','');$@ and $@ =~ s/ at .*//, print $DB::OUT ($@);my
$savout = select($DB::OUT);dumpvar_epic::dumplex($_,$h->{$_},defined $option{dumpDepth}
? $option{dumpDepth} : -1,@vars) for sort keys %$h;print "E";select($savout);};


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

  DB<9> o frame=0


Unmatched right curly bracket at (eval 10)[/usr/share/perl/5.8/perl5db.pl:628]
line 2, at end of line
syntax error at (eval 10)[/usr/share/perl/5.8/perl5db.pl:628] line 2, near
";}"

  DB<10> ;{do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dumpvar_epic;defined
&dumpvar_epic::dumpvar_epic or print $DB::OUT "dumpvar_epic.pm not available.\n";my
$savout = select($DB::OUT);dumpvar_epic::dumpvar_epic();select($savout);};


               frame = '0'
  DB<11> a

When I run the debugger myself there is no error:

root@notebook:/home/seitfa/workspace/epic_test # perl -I/home/seitfa/.eclipse/org.eclipse.sdk.ide/updates/eclipse/plugins/org.epic.debug_0.3.2/
-d  /home/seitfa/workspace/epic_test/test.pl

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/seitfa/workspace/epic_test/test.pl:1):
1:      my $test = "hallo";
  DB<1> .
Hi,

i tried what you said, here is the output of perl -d in eclipse:

“T

  DB<5> .

main::(/home/seitfa/workspace/epic_test/test.pl:1):
1:	my $test = "hallo";
  DB<6> .

main::(/home/seitfa/workspace/epic_test/test.pl:1):
1:	my $test = "hallo";
  DB<7> o frame=0


               frame = '0'
  DB<8> ;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpvar_epic::dumpvar_epic
or print $DB::OUT "dumpvar_epic.pl not available.\n";my $h = eval { PadWalker::peek_my(2)
};my @vars = split (' ','');$@ and $@ =~ s/ at .*//, print $DB::OUT ($@);my
$savout = select($DB::OUT);dumpvar_epic::dumplex($_,$h->{$_},defined $option{dumpDepth}
? $option{dumpDepth} : -1,@vars) for sort keys %$h;print "E";select($savout);};


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

  DB<9> o frame=0


Unmatched right curly bracket at (eval 10)[/usr/share/perl/5.8/perl5db.pl:628]
line 2, at end of line
syntax error at (eval 10)[/usr/share/perl/5.8/perl5db.pl:628] line 2, near
";}"

  DB<10> ;{do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dumpvar_epic;defined
&dumpvar_epic::dumpvar_epic or print $DB::OUT "dumpvar_epic.pm not available.\n";my
$savout = select($DB::OUT);dumpvar_epic::dumpvar_epic();select($savout);};â€


               frame = '0'
  DB<11> a


So I did this manually:


“root@notebook:/home/seitfa/workspace/epic_test # perl -I/home/seitfa/.eclipse/org.eclipse.sdk.ide/updates/eclipse/plugins/org.epic.debug_0.3.2/
-d  /home/seitfa/workspace/epic_test/test.pl

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/seitfa/workspace/epic_test/test.pl:1):
1:      my $test = "hallo";
  DB<1> .
main::(/home/seitfa/workspace/epic_test/test.pl:1):
1:      my $test = "hallo";
  DB<1> o frame=0
               frame = '0'
  DB<2> ;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpvar_epic::dumpvar_epic
or print $DB::OUT "dumpvar_epic.pl not available.\n";my $h = eval { PadWalker::peek_my(2)
};my @vars = split (' ','');$@ and $@ =~ s/ at .*//, print $DB::OUT ($@);my
$savout = select($DB::OUT);dumpvar_epic::dumplex($_,$h->{$_},defined $option{dumpDepth}
? $option{dumpDepth} : -1,@vars) for sort keys %$h;print "E";select($savout);};
E
  DB<3> o frame=0
               frame = '0'
  DB<4> ;{do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dumpvar_epic;defined
&dumpvar_epic::dumpvar_epic or print $DB::OUT "dumpvar_epic.pm not available.\n";my
$savout = select($DB::OUT);dumpvar_epic::dumpvar_epic();select($savout);};
NS00000003$^AS00000002''NS00000003$^DS000000010NS00000003$^ES00000002''NS00000003$^FS000000012NS00000003$^HS00000003256NS00000003$^LS00000005"\cL"NS00000003$^OS00000007'linux'NS00000003$^PS00000003831NS00000003$^SS000000011NS00000007$^TAINTS000000010NS00000009$^UNICODES000000010NS00000003$^VS0000000b"\cE\cH\cG"NS00000003$^WS000000010NS0000000e$^WARNING_BITSS00000026"\c@\c@\c@\c@\c@\c@\c@\c@\c@\c@\c@\c@"NS00000003$^XS0000000f'/usr/bin/perl'NS00000002$!â€
...




It looks like the sting passed to the perl-debugger has been cut, but has
been printed to the console with the full length. I counted the charters
in the string: 555.

Is the string probably to long for the variable?

Or what do you think?
jploski wrote on Wed Jul  5 19:26:25 MEST 2006:
From your provided output I infer that the manually executed session behaves
correctly. I compared your output to what happens in my (working) installation
of EPIC. We only need to look as far as the "E" being/not being printed
in response to the first eval command. It is printed by both your manual
session and my EPIC, but not by your EPIC.

The cut off string you mention should not concern us. It is not too long,
it just contains carriage return (\r) characters, so it looks weird. Again,
I don't think we need to look that far.

The next step would be to determine the difference in your perl -d invocation
from EPIC and the manual invocation. The only difference I can see in the
output is that you did not enter the 'T' command like EPIC. The next piece
of the puzzle to examine are environment variables - you should set them
(almost) exactly as EPIC does. Do not set the PERLDB_OPTS variable, though,
because it redirects the debugger's output to a TCP port.

Also worth examining would be the code location about which EPIC complains:
/usr/share/perl/5.8/perl5db.pl:628. In my installation, it contains this
Perl statement:
        @res = eval "$usercontext $evalarg;\n";  # '\n' for nice recursive
debug

I hacked the file to include the following debug output just above it:

open(FL, '>>/tmp/res');
print FL "{{{$usercontext $evalarg;\n}}}\n";
close(FL);

And here is what appeared in /tmp/res for the working version of EPIC (after
I started the debug session):

{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
printf $DB::OUT "%vd", $^V;;
}}}
{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpvar_epic::dumpvar_epic
or print $DB::OUT "dumpvar_epic.pl not available.\n";my $h = eval { PadWalker::peek_my(2)
};my @vars = split (' ','');$@ and $@ =~ s/ at .*//, print $DB::OUT ($@);my
$savout = select($DB::OUT);dumpvar_epic::dumplex($_,$h->{$_},defined $option{dumpDepth}
? $option{dumpDepth} : -1,@vars) for sort keys %$h;print "E";select($savout);};;
}}}
{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
;{do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dumpvar_epic;defined
&dumpvar_epic::dumpvar_epic or print $DB::OUT "dumpvar_epic.pm not available.\n";my
$savout = select($DB::OUT);dumpvar_epic::dumpvar_epic();select($savout);};;
}}}

Maybe you can also collect this output and notice some difference?
seitfa wrote on Thu Jul  6 00:10:37 MEST 2006:
> you did not enter the 'T' command

I tried it, still the same.

> examine are environment variables - you should set them (almost) exactly
as EPIC does

I don't know how to set them the best, I copied them out of EPIC, changed
them to perl-syntax and did it this way:

seitfa@notebook:~$ perl -I/home/seitfa/.eclipse/org.eclipse.sdk.ide/updates/eclipse/plugins/org.epic.debug_0.3.2/
-d  /home/seitfa/workspace/epic_test/test.pl

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/seitfa/workspace/epic_test/test.pl:1):
1:      my $test = "hallo";
  DB<1> ;%ENV = ('DBUS_SESSION_BUS_ADDRESS' => 'unix:abstract=/tmp/dbus-OD0nvOwI4i,guid=e228ac44e1ca2a1044a02526c1a0e500',
'HOME' => '/home/seitfa', 'JAVA_HOME' => '/usr/lib/jvm/java-gcj', 'LANGUAGE'
=> 'de_DE:de:en_GB:en', 'SSH_AGENT_PID' => 4763, 'LD_LIBRARY_PATH' => '/usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/jre/lib/i386:/usr/lib/mozilla',
'DISPLAY' => ':0.0', 'GTK_RC_FILES' => '/etc/gtk/gtkrc:/home/seitfa/.gtkrc:/home/seitfa/.kde/share/config/gtkrc',
'XDM_MANAGED' => '/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd,method=classic',
'SSH_AUTH_SOCK' => '/tmp/ssh-wCUoOn4730/agent.4730', 'PWD' => '/home/seitfa',
'GTK2_RC_FILES' => '/etc/gtk-2.0/gtkrc:/home/seitfa/.gtkrc-2.0:/home/seitfa/.kde/share/config/gtkrc-2.0',
'LANG' => 'de_DE.UTF-8', 'USER' => 'seitfa', 'XCURSOR_THEME' => 'default',
'LOGNAME' => 'seitfa', 'GS_LIB' => '/home/seitfa/.fonts', 'MOZILLA_FIVE_HOME'
=> '/usr/lib/mozilla', 'SHLVL' => 0, 'OLDPWD' => '/home/seitfa', 'DESKTOP_SESSION'
=> 'kde', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games',
'SHELL' => '/bin/bash', 'KDE_FULL_SESSION' => 'true', 'DM_CONTROL' => '/var/run/xdmctl',
'SESSION_MANAGER' => 'local/notebook:/tmp/.ICE-unix/4818', 'KDE_MULTIHEAD'
=> 'false');

  DB<2> T
  DB<2> .
main::(/home/seitfa/workspace/epic_test/test.pl:1):
1:      my $test = "hallo";
  DB<2> o frame=0
               frame = '0'
  DB<3> ;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpvar_epic::dumpvar_epic
or print $DB::OUT "dumpvar_epic.pl not available.\n";my $h = eval { PadWalker::peek_my(2)
};my @vars = split (' ','');$@ and $@ =~ s/ at .*//, print $DB::OUT ($@);my
$savout = select($DB::OUT);dumpvar_epic::dumplex($_,$h->{$_},defined $option{dumpDepth}
? $option{dumpDepth} : -1,@vars) for sort keys %$h;print "E";select($savout);};
E
  DB<4> o frame=0
               frame = '0'
  DB<5> ;{do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dumpvar_epic;defined
&dumpvar_epic::dumpvar_epic or print $DB::OUT "dumpvar_epic.pm not available.\n";my
$savout = select($DB::OUT);dumpvar_epic::dumpvar_epic();select($savout);};
NS00000003$^AS00000002''NS00000003$^DS000000010NS00000003$^ES00000002''NS00000003$^FS000000012NS00000003$^HS00000003256NS00000003$^LS00000005"\cL"NS00000003$^OS00000007'linux'NS00000003$^PS00000003831NS00000003$^SS000000011NS00000007$^TAINTS000000010NS00000009$^UNICODES000000010NS00000003$^VS0000000b"
...

It still works manually.

> hacked the file to include the following debug output

I did the hack, here is the output:

{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
printf $DB::OUT "%vd", $^V;;
}}}
{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpv;
}}}
{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
ar_epic::dumpvar_epic or print $DB::OUT "dumpvar_epic.pl not available.\n";my
$h = eval { PadWalker::peek_my(2) };my @vars = split (' ','');$@ and $@
=~ s/ at .*//, print $DB::OUT ($@);my $savout = se;
}}}
{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
lect($DB::OUT);dumpvar_epic::dumplex($_,$h->{$_},defined $option{dumpDepth}
? $option{dumpDepth} : -1,@vars) for sort keys %$h;print "E";select($savout);};;
}}}
{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
;{do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dumpvar_epic;defined
&dumpvar_epic::dumpvar_epic or print $DB::OUT "dumpvar_epic.pm not available.\n";my
$savout = select($DB::OUT);dumpvar_epic::dumpvar_epic();select($savout);};;
}}}

It is different in the second part:

yours:


{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;

;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpvar_epic::dumpvar_epic
or print $DB::OUT "dumpvar_epic.pl not available.\n";my $h = eval { PadWalker::peek_my(2)
};my @vars = split (' ','');$@ and $@ =~ s/ at .*//, print $DB::OUT ($@);my
$savout = select($DB::OUT);dumpvar_epic::dumplex($_,$h->{$_},defined $option{dumpDepth}
? $option{dumpDepth} : -1,@vars) for sort keys %$h;print "E";select($savout);};;

}}}

mine:

{{{($@, $!, $^E, $,, $/, $\, $^W) = @saved;package main; $^D = $^D | $DB::db_stop;
;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpv;
}}}

Do you have any Idea why this happens or is it just because of the different
(perl) source-code?

However both seem to be failed perl-syntax.

jploski wrote on Thu Jul  6 07:40:11 MEST 2006:
Forget about the environment variables. The difference you identified is
the error's reason. The syntax used in my snippet is not failed (if you
run perl -c on it, it compiles fine). However, your snippet produces the
error message.

I suspect that perl5db.pl is not receiving the whole command from EPIC for
some reason. Can you confirm that? 

I put a debug output before the line with "share($cmd)" in perl5db.pl:

open(FL, ">>/tmp/res2");
print FL "{{{$cmd}}}\n";
close(FL);

This is the output that I get:

{{{printf $DB::OUT "%vd", $^V;


}}}
{{{o frame=2

}}}
{{{{$| = 1; my $old = select STDERR; $|=1;select $old;}


}}}
{{{T

}}}
{{{.

}}}
{{{.

}}}
{{{o frame=0


}}}
{{{;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpvar_epic::dumpvar_epic
or print $DB::OUT "dumpvar_epic.pl not available.\n";my $h = eval { PadWalker::peek_my(2)
};my @vars = split (' ','');$@ and $@ =~ s/ at .*//, print $DB::OUT ($@);my
$savout = select($DB::OUT);dumpvar_epic::dumplex($_,$h->{$_},defined $option{dumpDepth}
? $option{dumpDepth} : -1,@vars) for sort keys %$h;print "E";select($savout);};


}}}
{{{o frame=0


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


}}}
jploski wrote on Thu Jul  6 19:06:58 MEST 2006:
I think there is a bug in sub readline in perl5db.pl. Look at this part:

my $stuff;
$IN->recv( $stuff, 2048 );
$stuff;

This is supposed to return the next full command line from the client. However,
I don't see why it always should work (the recv system call just returns
whatever data is currently available from the socket; it does not care about
end-of-lines). Indeed, you seem to receive this line in two pieces, the
first piece being 200 bytes long (no idea whether this magic number has
some relevance).

The correct behaviour of your standalone sessions with perl -d is explained
by the fact that they do not use the offending bit of code (because there
is no socket communication).

The solution? Try replacing the recv code with the following loop:

my $buf = '';
my $stuff = 'x';
while (!($buf =~ m/\n/) && length($stuff) > 0)
{
    $IN->recv($stuff, 2048);
    $buf .= $stuff;
}
$buf;

If that helps you, consider filing a bug with Perl developers.
seitfa wrote on Thu Jul  6 17:59:51 MEST 2006:
Hi,

> snippet is not failed (if you run perl -c on it, it compiles fine)

Sorry, I ment valid.

I did the your hack, here is the output:

root@notebook:/usr/share/perl/5.8 # cat /tmp/res2
{{{printf $DB::OUT "%vd", $^V;


}}}
{{{o frame=2

}}}
{{{{$| = 1; my $old = select STDERR; $|=1;select $old;}


}}}
{{{T

}}}
{{{.

}}}
{{{.

}}}
{{{o frame=0


}}}
{{{;{eval { require PadWalker; PadWalker->VERSION(0.08) }or print $DB::OUT
("PadWalker module not found - please install\n");do 'dumpvar_epic.pm' unless
defined &dumpvar_epic::dumpvar_epic;defined &dumpv}}}
{{{ar_epic::dumpvar_epic or print $DB::OUT "dumpvar_epic.pl not available.\n";my
$h = eval { PadWalker::peek_my(2) };my @vars = split (' ','');$@ and $@
=~ s/ at .*//, print $DB::OUT ($@);my $savout = select($DB::OUT);dumpvar_epic::dumplex($_,$h->{$_},defined
$option{dumpDepth} ? $option{dumpDepth} : -1,@vars) for sort keys %$h;print
"E";select($savout);};


}}}
{{{o frame=0


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


}}}

There are some differences.

Any idea?

Thanks for your help.
seitfa wrote on Thu Jul  6 22:08:34 MEST 2006:
Sorry, I read your comment just after I posted mine.

I have done your fix.

It works!

It's a bug in the perl5db.pl.

There are no more errors left while debugin a perl-proc.

I'll post the bug to the perl developers.

Thanks for your help.
mtwomey wrote on Thu Aug 17 23:07:05 MEST 2006:
I also had the exact same problem and this solved the issues for me. patching
from the 5.8 directory just above:

--- 5.8/perl5db.pl	2006-08-17 15:00:56.000000000 -0500
+++ 5.8new/perl5db.pl	2006-08-17 15:00:44.000000000 -0500
@@ -6354,12 +6354,16 @@
         $OUT->write( join( '', @_ ) );
 
         # Receive anything there is to receive.
-        my $stuff;
-        $IN->recv( $stuff, 2048 );    # XXX "what's wrong with sysread?"
+	my $buf='';
+        my $stuff='x';
+	while(!($buf=~ m/\n/)&&length($stuff)>0){
+          $IN->recv( $stuff, 2048 );    # XXX "what's wrong with sysread?"
                                       # XXX Don't know. You tell me.
+	  $buf.=$stuff;
+	}
 
         # What we got.
-        $stuff;
+        $buf;
     } ## end if (ref $OUT and UNIVERSAL::isa...
 
     # No socket. Just read from the terminal.


jgangemi wrote on Thu Aug 17 23:24:21 MEST 2006:
could you clarify exactly where this patch is applied
pacanukeha wrote on Thu Aug 17 23:32:13 MEST 2006:
And why the spacing/tabbing doesn't seem to line up? ;)
seitfa wrote on Wed Sep  6 23:49:52 MEST 2006:
Good news. This bug has been fixed:

Steve Peters (Maintainer of the perl Ubuntu-Package) wrote:

> This has been fixed in the development version of > Perl.  The change
is available here:
> .
rupert160 wrote on Mon Dec 15 13:05:10 CET 2008:
It might not be completely fixed, I'm running: 
   perl 5.8.8 with 
   Ubuntu 8.04 x64, 
   EPIC 0.5.46, 
   Eclipse 3.2.2-5ubuntu2, 
   PadWalker-1.7 (installed from source/make - no errors)

Running the error log in Eclipse returns:
   An error occurred while parsing debugger variables; 
   contents of the Variables view may be inaccurate. 
   Failure caused by string: {syntax error at (eval 10)[/usr/share/perl/5.8/perl5db.pl:628]
line 2, near ";
   or"
   }

and I have opened up the only perl5db.pl file on my computer: 

   /usr/share/perl/5.8/perl5db.pl

and I believe I found the code snippet you were working with is here:

   6356         # Receive anything there is to receive.
   6357         $stuff;
   6358         my $stuff = '';
   6359         my $buf;
   6360         do {
   6361             $IN->recv( $buf = '', 2048 );   # XXX "what's wrong
with sysread?"  
   6362                                             # XXX Don't know. You
tell me.
   6363         } while length $buf and ($stuff .= $buf) !~ /\n/;
   6364 
   6365         # What we got.
   6366         $stuff;

This is amended with the changes you have talked about and there remains
this error.
further to this, I cannot get variable debugging at this point.

Look forward to your advice. Sorry about the bad news.



jploski wrote on Mon Dec 15 13:09:50 CET 2008:
Which version of Java? If you are using gcj, switch to Sun's version. This
should fix the bug and improve overall performance, too.
rupert160 wrote on Mon Dec 15 13:24:38 CET 2008:
I'm afraid i've been googleing for two evenings now and just 5 mins after
posting above I saw this:

https://sourceforge.net/forum/forum.php?thread_id=2202681&forum_id=258688

So I'll install the Sun Java and get back to you (quick response btw!).
Is there a recommended procedure for ubuntu'ers to remove gcj and install
the java binary? there are a lot of posts on how to do it, but i'm worried
it could damage my eclipse installation?

Does this way look safe?

http://www.cyberciti.biz/faq/howto-ubuntu-linux-install-configure-jdk-jre/
jploski wrote on Mon Dec 15 13:49:30 CET 2008:
I think that the procedure described there is ok. It's probably a good idea
to follow this sort of procedure to keep your distribution happy. 

If you just want to try it out, then it's very easy to install Java in a
separate directory and just make Eclipse use it. In fact, I have so many
versions of Java on my box that I only use the following Linux distribution
neutral procedure:

1. Download the compressed .sh archive from Sun. When you run it, it creates
a new directory tree. You can move it subsequently to whereever you like
(presumably /opt or /usr/local).
2. Instead of starting the 'eclipse' binary directly, write a small wrapper
script like

export JAVA_HOME=/path/to/the/extracted/java/root/directory
export PATH=$JAVA_HOME/bin:$PATH
eclipse $*

This is also good if you want to set parameters for the Eclipse VM, most
notably to increase the maximum heap memory available to Eclipse (if you
get OutOfMemoryErrors). Or if you want to specify the workspace path (using
the -data parameter).
rupert160 wrote on Mon Dec 15 22:53:24 CET 2008:
Actually Ubuntu's got a JVM manager I discovered:

http://www.friendlyarm.com/install-eclipse-33-on-ubuntu-804/

So I followed these instructions, I now get: 
$java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)

It seems Eclipse manages it's JVM's. (Preferences>java>Installed JREs
So I moved the Eclipse JVM machine path over to the sun JVM:
/usr/lib/jvm/java-6-sun

(seems I have access to all these now:
java-1.5.0-gcj-4.2-1.5.0.0  java-6-sun  java-6-sun-1.6.0.07  java-gcj)

After rebuild I still get no variable debugging.
yunfengli wrote on Mon Dec 15 23:00:20 CET 2008:
You may try to edit /etc/eclipse/java_home, and put the sun's java at the
top of the list.

It solved my problem last time.

Cheers,
jploski wrote on Tue Dec 16 00:27:45 CET 2008:
The JVMs inside of Eclipse are for programs that you run from Eclipse. To
check which JVM Eclipse itself is running with, use Help/About Eclipse SDK/Configuration
Details (look at java.vendor and java.version there).
jploski wrote on Tue Dec 16 00:36:59 CET 2008:
I should also add that I have bad experiences with running 64-bit JVM+64-bit
Eclipse under Linux (in terms of it crashing randomly). 32-bit JVM + 32-bit
Eclipse were more stable for me on a 64-bit machine.
rupert160 wrote on Tue Dec 16 11:16:47 CET 2008:
Actually Ubuntu's got a JVM manager I discovered:

http://www.friendlyarm.com/install-eclipse-33-on-ubuntu-804/

So I followed these instructions, I now get: 
$java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)

It seems Eclipse manages it's JVM's. (Preferences>java>Installed JREs
So I moved the Eclipse JVM machine path over to the sun JVM:
/usr/lib/jvm/java-6-sun

(seems I have access to all these now:
java-1.5.0-gcj-4.2-1.5.0.0  java-6-sun  java-6-sun-1.6.0.07  java-gcj)

After rebuild I still get no variable debugging.
jploski wrote on Tue Dec 16 11:25:42 CET 2008:
I'm confused - as you already posted the same message here: https://sourceforge.net/forum/message.php?msg_id=5819900
rupert160 wrote on Tue Dec 16 11:24:58 CET 2008:
yunfengli your suggested fix worked! Debugging now works!

jploski you are seem to be correct too. 
When I did Help/About Eclipse SDK/Configuration, I got the correct vendor
java.vendor.url=http://java.sun.com/

Thanks so much everyone. I've been trying for days to fix this!

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