3

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.";
       }
}
.
.

The code from the beginning until the part shown above can be found here

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.

UPDATE I've enabled the EPIC "Debugger Console (experimental)" and it seems that there is an error appears when I reach the problematic module during the debug process. Unfortunately I'm unable to read and understand this debugger data. The error is a very long message which partly pasted below:

S00000003$^AS00000002''NS00000003$^DS000000010NS00000003$^ES0000001b'No such file or directory'NS00000003$^FS000000012NS00000003$^HS00000003256NS00000003$^LS00000003

Full error message is available through this link

Maybe this will spill some light..

UPDATE 2 I've been suggested to verify that the relevant module path exist in "Perl Include Path' in project properties in Eclipse. I've done so however unfortunately with no change.

Eugene S
  • 6,709
  • 8
  • 57
  • 91
  • Show some code for which this happens. If we cannot [reproduce the unexpected behaviour](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html#showmehow), we can only take a wild mass guessing about what's wrong. – daxim Mar 19 '12 at 10:14
  • @daxim Added a code example and some more info. – Eugene S Mar 19 '12 at 12:07

3 Answers3

2

To get the use lib with relative paths working, I patched Cwd.pm (again)... add a chomp.


sub fast_abs_path {
    local $ENV{PWD} = $ENV{PWD} || ''; # Guard against clobberage
    my $cwd = getcwd();
    require File::Spec;
    my $path = @_ ? shift : ($Curdir ||= File::Spec->curdir);

    # Detaint else we'll explode in taint mode.  This is safe because
    # we're not doing anything dangerous with it
    ($path) = $path =~ /(.*)/s;
    ($cwd)  = $cwd  =~ /(.*)/s;

    chomp($path);  # <<<-- added this chomp here

    unless (-e $path) {

There maybe a better fix in the EPIC code, a chomp before calling fast_abs_path, but an extra chomp never hurts anything...

-David

David A
  • 21
  • 2
1

I think, EPIC plugin cannot able to find that module. I am just guessing here:

Did you set the @INC properly?

http://www.epic-ide.org/guide/ch03s02.php

Did you setup the PadWalker module?

http://www.epic-ide.org/guide/ch02s09.php

Did you set/check PERLLIB/PERL5LIB env variables?

user1126070
  • 5,059
  • 1
  • 16
  • 15
  • Hi and thank you for your comments! The thing is that the rest of the modules (at least those I've been working with) actually do work as expected. I mean that EPIC do skip to the relevant *.pm files while debugging. You might be right regarding the path issue. I will try to check it according to the configuration in the link you've provided and update. Thanks again! – Eugene S Mar 21 '12 at 19:57
  • I've tried to add the modules path to the "Perl include path" as explained in the user guide you mentioned but unfortunately it didn't help. However I tried to use the EPIC "Debugger console (experimental)" and it seems that there are some errors when reaching the problematic modules which might be relevant. It seems like: `NS00000003$^AS00000002''NS00000003$^DS000000010NS00000003$^ES0000001b'No such file or directory'NS00000003$^FS000000012NS00000003$^` Maybe this will give some clue? – Eugene S Mar 25 '12 at 13:08
  • It somehow did not found the module file. Check how do call this module, how it is different from the others tahat works. Is there an use lib '/somepath' or are you use FindBin to locate the module or are you using other method to find your module? – user1126070 Mar 26 '12 at 08:33
  • Please show us the first part of the srcript, where you include your module. From shebang (#!/perl...) to use sys_manager line. – user1126070 Mar 26 '12 at 08:36
  • Please find the full code (from the beginning) added as a link. Thanks! – Eugene S Mar 27 '12 at 07:48
0

It seems that I've realized how to solve this issue. As it's visible from the code attached as a link in the initial question, there is the following line:

use lib '..';

Which is a module which simplifies the manipulation of @INC at compile time, pointing to Perl modules which are not located at their default path (/usr/share/perl/5.10.1/). For some reason, these modules could be run but I could not "Step into" them. When I copied one of the modules to the (/usr/share/perl/5.10.1/) path, I could perform the "Step Into" during the debug.

The only question remain is how to make the modules which are not located in /usr/share/perl/5.10.1/ to be fully available for debug. But I guess that this is the topic for an additional question.

Eugene S
  • 6,709
  • 8
  • 57
  • 91
  • I encounter this problem quite often, and I don't know how to solve it. Copying the "unseen" modules to the main project directory, is not a good solution, it's a clunky workaround. – Helen Craigman Jul 17 '13 at 18:42