condition on breakpoints

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

    James A. Lahm - 2004-07-07

    I cannot seem to get the condition working on breakpoints. I can set the condition to a value, but the debugger will ignore the condition and stop on every pass through the breakpoint. Am I missing something? :-)

    Jim

     
    • James A. Lahm

      James A. Lahm - 2004-07-09

      I believe I have found the problem. In the dbTemplate.txt debugger control file in subroutine DB, 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.

      Jim

       
    • James A. Lahm

      James A. Lahm - 2004-07-15

      My apologies - I posted an incorrect fix. In dbTemplate.txt subroutine DB, replace:

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

      with:

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

      This will allow the debugger to stop at conditional breakpoints such as "$x==10" or "length($x)>5".

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks