Switch to Perl module file view during debug

Help
Eugene S
2012-03-21
2013-05-20
  • Eugene S

    Eugene S - 2012-03-21

    Hi folks!

    I am using Eclipse GALILEO running on Linux Ubuntu with EPIC plugin to Run/Debug Perl code and I'm experiencing some problems while debugging. Usually, when I do step-by-step debugging and encounter a line where a certain Perl module is used, I click "Step Into" and then the module file is being viewed and the debugging arrow migrates there also. Now it seems that there are certain modules which do not follow this scenario. Instead, when I click "Step Into", the running process is taking place somewhere at the background. I mean I can press "Step Over" and I will see results of a code which is being performed, but I cannot see the file itself nor the arrow.

    To make it a bit clearer please refer to the following piece of code:

    .
    .
    if (defined($sysname) && $sysname)
    {
    $sys_manager->setup_from_name($sysname);
    $pf_manager->setup_from_name($sysname);
    } else {
    die "You must give either a --system parameter or an alias name.";
           }
    }
    .
    .
    

    I perform Step-by-Step debug until I reach the

    $sys_manager->setup_from_name($sysname);
    

    line. When I reach it, I click on "Step Into" button (rather than on "Step Over"). Then I expect one more window to be opened in eclipse, which will switch view to the module where this setup_from_name method exist. However, as I mentioned before, the "debugging arrow" disappears. At this stage, if I click "Step Over" button, the running continues somewhere at the background (I can see that the variables are being modified). If I click on "Step Return", the arrow appears again and continue through the visible code.

    I'd also like to mention that these specific modules were provided as-is and not installed using CPAN. The packages location relative to the code which is using them is as follows:

    folder A/    #General folder
      folder B/  #Where the scripts which use the above mentioned modules are located
      folder C/  #Where the modules are located
    

    I hope that my question is clear enough however if it's not please comment and I will clarify.

    Thanks in advance!!

     
  • Jan Ploski

    Jan Ploski - 2012-03-21

    You haven't mentioned your version of EPIC. You should upgrade to 'testing' if you haven't yet done so.

    Looking at contents of the "Debugger console (experimental)", which you can enable through EPIC preferences, may give a clue as to what is going on. I suspect some problems with paths in the file system (symlinks, mounts etc.) or maybe something with 'eval'.

     
  • Eugene S

    Eugene S - 2012-03-22

    You haven't mentioned your version of EPIC. You should upgrade to 'testing' if you haven't yet done so.

    Looking at contents of the "Debugger console (experimental)", which you can enable through EPIC preferences, may give a clue as to what is going on. I suspect some problems with paths in the file system (symlinks, mounts etc.) or maybe something with 'eval'.

    Hi and thank you for your comments!
    The EPIC version, as it appears in Eclipse "Installed Software" list, is 0.5.46.

    I'm not sure what did you mean when you wrote "upgrade to testing"? Can you please explain?

    I've enabled the EPIC Debugger Console and ran the scenario again. It seems that you're right regarding the system links since I can see the following error message (as a part of much longer output) which mentions "No such file or directory" (however it's only my guess that this is related):

    NS00000003$^AS00000002''NS00000003$^DS000000010NS00000003$^ES0000001b'[b]No such file or directory[/b]'NS00000003$^FS000000012NS00000003$^HS00000003256NS00000003$^LS00000003''NS00000003$^OS00
    

    I'd like to mention again, that these specific modules which I have this problem with were not installed using CPAN but were just copied as-is and then added by me to the Linux environment path. Do I miss some other PATH I should have added? What's also seems strange to me is that these module are actually perform normally but there is only a problem when debugging..

    Thanks!

     
  • Jan Ploski

    Jan Ploski - 2012-03-22

    By "update to testing" I mean install the 'testing' version (0.6.x) through Help > Software Updates… - as explained on http://epic-ide.org/download.php

    The debugger plugin in the testing version is different enough that your problem may be fixed.

    I don't think the "No such file or directory" is relevant, it is probably just a string inside some dumped (internal) Perl variable. The problem that you describe resembles previously reported issues with skipped breakpoints. Basically, whenever "perl -d" reports to EPIC the current instruction, it sends back a path and a line number (this should be visible in the debugger console). EPIC then has to translate this path to a "resource path" accessible within the Eclipse workspace, either a relative path in your project or a path within the special epic_links project. If the translation fails for some reason, it cannot open the file (or cannot find out which breakpoint was hit).

    Because you mention Linux environment path I suspect that maybe you haven't set the "Perl Include Path" under project Preferences in Eclipse. Setting PERL5LIB or some such is not necessary. The correct way is to enter a project-relative path there, e.g. if your project is at /somewhere/workspace/project and you have the modules in /somewhere/workspace/project/folder_c, just add "folder_c".

     
  • Eugene S

    Eugene S - 2012-03-25

    Hi and thank you again for your comments!

    First of all regarding your suggestion about testing EPIC version. I wonder whether I will be able to switch it to my current version back in case I wish to?

    I've read your explanation regarding the known issue and made changes to my "Perl Include Path" which did not contain the modules path. But unfortunately it seems it did not affect the behavior.

    Anyway, I've spotted the following error appearing in the console after stepping in to:

    GT::Conf::load();
    

    which is one of the modules being used.
    Maybe I missed this error before:

    NS00000003$^AS00000002''NS00000003$^DS000000010NS00000003$^ES00000012'Invalid argument'NS00000003$^FS000000012NS00000003$
    

    Full error is here http://justpaste.it/u6p

    BTW, is there some kind of tutorial as to how to read this console output?

    Thanks!

     
  • Jan Ploski

    Jan Ploski - 2012-03-25

    You can uninstall 'testing' and install 'stable' back later if you so desire. However, I've been on 'testing' for years now myself with no problems - there is little development going on.

    The quoted string is not an error message. It is part of a dump of variables' content, as requested by EPIC and delivered by perl -d. There is no tutorial, as it's an implementation detail, which I think also looks different between stable and testing. A technical description of the internal dump format for 'testing' can be found at the end of https://github.com/jploski/epic-ide/blob/testing/org.epic.debug/dumpvar_epic.pm There is also some comments that may be relevant at the end of https://github.com/jploski/epic-ide/blob/testing/org.epic.debug/epic_breakpoints.pm

     
  • Eugene S

    Eugene S - 2012-03-26

    Thank you for the explanation and links! Can you please describe how can I correctly uninstall my current EPIC version in order to install the testing one later on?

    Thanks!

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks