#651 Problem showing variables in debug

v0.6.x
open
Debugger (177)
5
2016-05-15
2012-10-22
Anonymous
No

Hi

I am trying to debug perl code with eclipse Juno 4.2.1 Build id: M20120914-1800 on Mac OS X Mountain Lion with EPIC v 0.6.45 (Debug plug-in v. 0.6.32). What happens is that I get the following error in the Variables view or if I just try to see the local variables I get an empty view without any variables.

--------
An error occurred while dumping Perl internal variables; contents of the Variables view may become invalid
--------

Debug view shows:
--------
DB<12> ;{
do 'dumpvar_epic.pm' unless defined &dumpvar_epic::dump_package_vars;

my $savout = select($DB::OUT);
dumpvar_epic::_dump_entity('@_', \@_);
dumpvar_epic::dump_package_vars();
select($savout);
};

2|@_
DB<13>
--------

and error log shows

java.lang.StringIndexOutOfBoundsException: String index out of range: 4
at java.lang.String.charAt(String.java:686)
at org.epic.debug.db.DumpedEntityReader.token(DumpedEntityReader.java:46)
at org.epic.debug.db.DumpedEntityReader.nextEntity(DumpedEntityReader.java:34)
at org.epic.debug.db.StackFrame.dumpInternalVars(StackFrame.java:303)
at org.epic.debug.db.StackFrame.getVariables(StackFrame.java:187)
at org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider.getAllChildren(StackFrameContentProvider.java:51)
at org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider.getChildCount(StackFrameContentProvider.java:28)
at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.retrieveChildCount(ElementContentProvider.java:114)
at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$2.run(ElementContentProvider.java:63)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

What could I do to fix this?

Regards,

Lauri

Discussion

<< < 1 2 (Page 2 of 2)
  • David Vavra

    David Vavra - 2014-03-15

    FWIW, I have a similar problem. I've discovered that if $\ is undefined then I can view variables. However, if $\ is redefined (to say "\n") then this problem occurs immediately after the redefinition.

    Of course, this may not be the only cause.

    dumpvar_epic.pm should be changed otherwise it will not be possible to view variables in any block containing a modified $\

    I've been trying to find the source used to create ./workspace/.metadata/.plugins/org.epic.debug/dumpvar_epic.pm to modify it but haven't been able to locate it so far. Maybe somebody can give me a hint? Above it says:

    a copy of dumpvar_epic.pm from the org.epic.debug plugin directory is written before each launch the workspace/.metadata/.plugins/org.epic.debug directory

    However, the only thing less helpful would be that it's stored somewhere on the hard drive. Where would the org.epic.debug plugin directory be located?

    If it's any help, I'm using

    Eclipse Platform

    Version: 4.2.1
    Build id: M20120914-1800

    Epic plugin 0.6.39
    PadWalker-1.98

    UPDATE:
    I modified workspace/.metadata/.plugins/org.epic.debug/dumpvar_epic.pm and placed it in the project directory which is first in the include path.

    The change I made was:

    ...
    sub _dump_entity
    {
    local $\ = undef;
    ...

    Near line 120. Haven't had display problems since.

    Still can't locate where the one in workspace/.metadata/.plugins/org.epic.debug/dumpvar_epic.pm is coming from. I searched my entire drive for "dumpvar*epic*" and could only find the one that gets changed on every debug so it seems to be called something else.

    It's not really important but I would like to fix it more or less permanently so I don't have to go through this for every project.

    UPDATE2:
    I located a copy in /usr/share/eclipse/dropins/epic/eclipse/plugins/org.epic.debug_0.6.32.jar but after I updated the jar file I got strange errors (which I've forgotten) from Eclipse. I'm running short of time so I restored the jar file and am using the modifications I specified above in the first update.

    BTW: I just noticed that the 0.6.32 doesn't match the Epic plugin version of 0.6.39. probably not important as I can't find any other but ... ?

     
    Last edit: David Vavra 2014-03-16
  • DonComo da Como

    DonComo da Como - 2015-09-20

    Hi

    I'm using
    Eclipse CDT Platform
    Version: 4.5.0
    Build id: 20150621-1200

    Epic plugin 0.6.57
    PadWalker-2.1

    I also encountered the same problem when using code that modified the $\ variable.
    I've made the modifications proposed by David Vavra

    The change I made was:

    ...
    sub _dump_entity
    {
    local $\ = undef;
    ...

    Near line 120. Haven't had display problems since.

    and it seems to have solved the problem.

    Regarding David Vavras

    I've been trying to find the source used to create ./workspace/.metadata/.plugins/org.epic.debug/dumpvar_epic.pm to modify it but haven't been able to locate it so far. Maybe somebody can give me a hint?

    the source file dumpvar_epic.pm is the one found in <eclipse install>\plugins\org.epic.debug_0.6.xx.jar.
    I've applied the patch here and it seems to work across workspaces. Hope it helps.

    By the way, how do you guys get to see this type of debug trace using EPIC?
    (from OP)

    Debug view shows:

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

    my $savout = select($DB::OUT);
    dumpvar_epic::dump_entity('@', \@_);
    dumpvar_epic::dump_package_vars();
    select($savout);
    };

    2|@_
    DB<13>

     
  • Philippe A.

    Philippe A. - 2016-01-21

    Awesome. I applied David Vavra's suggestion and it fixed my problem with the debugger not showing variables value. I tend to put -l on my perl script headers, which is equivalent to setting $\.

     
    Last edit: Philippe A. 2016-01-21
  • Oliver Trosien

    Oliver Trosien - 2016-05-15

    @jploski - do you recall if you considered applying the suggested change in dumpvar_epic.pm ?

     
<< < 1 2 (Page 2 of 2)

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

Sign up for the SourceForge newsletter:





No, thanks