Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#65 Conditional debugging not working

open
nobody
None
5
2004-07-09
2004-07-09
James A. Lahm
No

I was unable to get the conditional debugging capability
to work. If a condition was present on a breakpoint, the
debugger never stopped at the breakpoint.

It appears that the following fix works. In the
dbTemplate.txt file in the patch for 5.8, locate the DB
subroutine and replace the line:

my $value = InternalEvalCode("return
$package::$condition;");

with:

my $newparam = substr($condition, 0, 1);
$newparam .= $package.'::';
$newparam .= substr($condition, 1);
my $value = InternalEvalCode("$newparam");

This appears to work and the debugger now will stop at
a breakpoint ONLY when the condition is true.

Discussion

  • James A. Lahm
    James A. Lahm
    2004-07-15

    Logged In: YES
    user_id=511392

    My changes were incorrect. The dbTemplate.txt subroutine
    DB should have the line:

    my $value = InternalEvalCode("return
    $package::$condition;");

    replaced with these:

    my $newparam=$condition;
    if (length($condition)>1) {
    my $qualifier=$package."::";
    $newparam=$condition;
    $newparam=~s/([\$\%\@])/$1$qualifier/g;
    }
    my $value = InternalEvalCode("$newparam");