Weird behavior of debugger.

Hi, first time using this product, I like it so far.

Coming from Flash Builder, I got a lot of feedback about several aspects of the IDE, but, there is something I can't live with, and that is the behavior the debugger has, for example, when I', doing a step over (I assume it works the same as in FB) sometimes it just breaks out from the method, and I've also noticed that somtimes the debugger stops at a random no-debug-point for some reason.

Not sure if this is known bug or what, but it's making my life impossible.

To illustrate it better:

private function updateCost(cost:int):void {

 
  _spent += cost;
  _costBar.update(-cost); //cost = 5
 
  //... more code

 }

//_costBar update method
public function update(value:int):void {

       if(value < 0) {

            _currentUnits += value; //-> after I press F8 here, the debugger goes back to the updateCost method instead of going down to the for expression

            for (var i:int; i < value; i++) {

                 var unit:Image = _units.pop();
                 unit.parent.removeChild(unit);

           }
     }
     //... more code


Thanks.

3 comments
Comment actions Permalink

Sorry for delay.
Look attentively at your code.

if(value < 0) {
...
        for (var i:int; i < value; i++) {...}
...
}

With value<0 your 'for' cycle is never executed, that's why debugger skips it.

IntelliJ IDEA uses FDB tool from the Flex SDK for debugging. If you see any issues with stepping - most likely those are FDB bugs that we can't fix at IDE side. But with your sample code I don't see any issues with stepping.

0
Comment actions Permalink

Yeah, after some tests I discovered that it wasn't actually a bug, but a different way to place the cursor. In FB, the cursor would sit on the for statement, then skip it. In IDEA, it skips it right away without even siting there in the first place, thus the confusion. Thanks.

Also I got confused some times because the debug cursor would stop at some "non-placed breakpoint", what actually was a runtime error. What I'd like to know is if there is a way to make the errors more visually... present, in the debugger. Is it only a theme thing?, Im using Darcula.

0
Comment actions Permalink

When debugger stops on error there should be an error message and stack trace in the Debugger console

0

Please sign in to leave a comment.