Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse doesn't display Perl module while debugging (with EPIC)

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.

like image 631
Eugene S Avatar asked Apr 23 '26 15:04

Eugene S


2 Answers

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

like image 170
David A Avatar answered Apr 27 '26 04:04

David A


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?

like image 25
user1126070 Avatar answered Apr 27 '26 03:04

user1126070



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!