#1 2010-04-11 11:08:20

unclepetros
Member
Registered: 2010-04-11
Posts: 88

How to debug gcstar project?

Hi,
I'm new to this forum, and to gcstar.
I like it, want to use it, and want to contribute to it.
I've found a problem with Bol and IBS book plugins.
They return nothing on any search.

So, I'm trying to debug plugins code in order to understand what's the problem and eventually fix it.

I've tried the EPIC plugin for Eclipse, but debug doesn't work.
It is impossible to use the "step into", "step over" and "return from step" functionality.

So, what's the way you use to develop and debug the project?
Or, what's the easiest way?

I'm new to Perl.
I use Ubuntu karmic 32bit.

Thank you.

Bye
UnclePetros

Offline

 

#2 2010-04-19 22:32:22

zombiepig
Moderator
Registered: 2007-08-30
Posts: 331

Re: How to debug gcstar project?

I haven't found any way of using an IDE to debug gcstar - if you do, I'd really like to hear big_smile

What I usually do is just use print statements throughout the code. The Data::Dumper module is really useful here - when I'm debugging plugins a

Code:

use Data::Dumper
print Dumper($variable)

is a good way to find out where things are.

There's also some command lines options that help when writing new plugins. I'll paste Tian's instruction on using them:

Code:

I just added something in the SVN repository. It may help you when you want to
debug plugins that fetch information. Sometimes, the website I really long for
answering. And when we want to fix some problems, we have to do a lot of
requests. So it may take time for each test.

Now, you can just add a variable to your environment before launching. It will
be in 1 phases. First, launch GCstar like that :

GCS_DEBUG_PLUGIN_PHASE=1 perl ./gcstar

(if you don't launch it from the bin directory, you'll obviously have to
adjust the path).

It will behave as usually. But it will store the downloaded pages in /tmp (or
whatever is the temporary directory on your system, as returned by
File::Spec->tmpdir).

Then for all the tests, you may launch it with the value 2 for this variable.

GCS_DEBUG_PLUGIN_PHASE=2 perl ./gcstar

It will reuse the previous files. You may easily find them in your temporary
directory as they begin with http. Actually, the file name is the url of the
page with special characters replaced with underscores.

You also have to know that these files will never be removed by GCstar. So if
you don't have some automatic cleanup of your temporary directory, you'll have
to remove them manually.

Hope this helps - if you've any more questions, just ask!

Offline

 

#3 2010-04-20 15:53:45

unclepetros
Member
Registered: 2010-04-11
Posts: 88

Re: How to debug gcstar project?

Thank you zombiepig for your hints.
As you can see I've posted some plugin fixes;
For these one I've used the good and old "label testing" (print "$variable").

As to the EPIC plugin for eclipse, I've read on a forum, debug worked with the previous version of the plugin.
Instead, in the latest one it doesn't work.

Anyhow I find very strange there is no good IDE for Perl with Code-completion and debug support.

I've seen other scripting language, like Ruby, and there is a lot of stuff for them.

Thank you again.

This is just the software I was looking for, and I'm very happy to contribute it.

Bye
UnclePetros

Offline

 

#4 2010-06-29 08:48:06

unclepetros
Member
Registered: 2010-04-11
Posts: 88

Re: How to debug gcstar project?

zombiepig wrote:

I haven't found any way of using an IDE to debug gcstar - if you do, I'd really like to hear big_smile

Hi zombiepig,
this morning I've downloaded the latest version of the EPIC plugin for Eclipse, and I'm happy to say it works fine smile.
Breakpoints works fine and local variables content is showed correctly.

I think it's the best for GCStar development and debug.

GCStar project integrates very well in Eclipse with EPIC.

The only steps to do are:

- Create a new perl project
- Import svn_version\gcstar\gcstar\ folder in it
- Set the path {project_location}/lib/gcstar in the Perl include path

and all works fine!

Bye
UnclePetros

Offline

 

#5 2010-06-29 08:52:46

zombiepig
Moderator
Registered: 2007-08-30
Posts: 331

Re: How to debug gcstar project?

Awesome - I'll have to check that out right away  big_smile

Offline

 



Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.