Re: Bug found in Open Perl IDE perl5db.pl module



On Jul 30, 5:21 am, mattsteel <matteo_vitt...@xxxxxxxxxxx> wrote:
Hello all.

I'm using this IDE since months, and have to say this is a good IDE,
light, simple, easy to use, but not bug-free ;-)

I found a subtle bug in perl5db.pl module (that is shipped with the
IDE for Windows available from SurceForge);

Trying this piece of script:

my $code = sub { print "hello\n" } ;
print "Let's call $code\n";
$code->();
print "Done.\n";

During a normal debug session, moving the mouse over the variable
$code (that is a code-reference i.e. ref($code) returns CODE), the IDE
replies with an “<undef>” which is not true. The same thing happens
listing $code in the “variable” watch-window.

I tried to fix it and patched the perl5db.pl module to handle this
case, so the IDE replies something like
“$code: code = 0x1a81c40”.

Since the module source is more than 700 lines long, I think useful
giving here the four chunks I added: I simply added another "elsif"
case just before the ending "else", so you should be able to insert
these few lines directly in your dbTemplate.txt in the correct
position.

#within SizeOfDerefValue sub:
} elsif ($refType eq 'CODE') {
return length($reference);

#within ShortEval sub:
} elsif ($refType eq 'CODE') {
$reference =~ /\((.*)\)/;
return "code = $1";

#within LongEval sub:
} elsif ($refType eq 'CODE') {
$reference =~ /\((.*)\)/;
$retValue = "code = $1";

#within ShowDerefValues sub:
} elsif ($refType eq 'CODE') {
$type = "code";
$reference =~ /\((.*)\)/;
$value = "$1";

I hope this helps.

Regards.


You might want to post this on Sourceforge if that's where the project
is located.

--S
.



Relevant Pages

  • Re: Umstieg von VB.NET auf C#
    ... VB.Net gebe ich "sub test" und Enter ein, die beiden Klammern und das End ... sub erstellt mir die IDE auotmatisch. ... dazu muss man den Namensraum noch exact angeben. ... oder ob es eine Schnittstelle implementiert. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Umstieg von VB.NET auf C#
    ... VB.Net gebe ich "sub test" und Enter ein, die beiden Klammern und das End ... sub erstellt mir die IDE auotmatisch. ... dazu muss man den Namensraum noch exact angeben. ... oder ob es eine Schnittstelle implementiert. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Weird bug in VS.NET 2003 IDE
    ... > From time to time, when I save my code, the IDE decides to add lines to ... > End Sub ... > End Namespace ... > the IDE adding all these lines is that the program fails to compile, ...
    (microsoft.public.vsnet.ide)
  • Umstieg von VB.NET auf C#
    ... VB.Net gebe ich "sub test" und Enter ein, die beiden Klammern und das End ... sub erstellt mir die IDE auotmatisch. ... dagegen ist das eingebaute C# Refactoring eher ... public Color TextBoxBackColor { ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Exception Handling difference between Design-Time and Run-Time
    ... About the bug. ... I'm not saying either way whether its the IDE thats at fault ... Instead I use global Exception handlers, as they largely do what I ... > Public Shared Sub Main ...
    (microsoft.public.dotnet.languages.vb)