4 Replies Latest reply on Jun 9, 2008 6:00 AM by Newsgroup_User

    Bugs in Debugger

    Level 7
      Have any of the following ever happened to you? Because they're beginning
      to happen more and more frequently to me for some reason...

      1. Program crashes, gives non-specific error message (e.g. "Cannot divide by
      zero", but without giving you the line of code that caused the error), and
      then you open the Debugger, and you get the little arrow pointing at the
      very first line in the script window, instead of the line with the error in
      it, leaving you to have to search the whole damn script (and often other
      related scripts) to figure out what went wrong. Usually this happens once
      in a row, and if you run the movie again and do the same thing that caused
      the error before (assuming that you can reproduce it), you'll get a proper
      error message and the Debugger arrow pointing at the correct line with the
      error.

      2. You notice after much gnashing of teeth and placing of breakpoints that a
      function call that's supposed to be calling one handler is instead calling
      the handler immediately before or after it in the same script. Usually this
      won't go away until you save/quit/reload.

      3. A line which *should* cause an error instead simply ignores the offending
      line, and all subsequent lines after it in the handler and keeps running
      (usually resulting in other seemingly-unrelated errors later on, dependant
      upon the script which didn't run.) Running the line-by-line trace on the
      script, the Debugger will always close at the line with the error, but
      again, not produce any error message, simply skip the rest of the handler
      and continue running. What usually seems to cause this one is referencing a
      property on a sprite or property list which doesn't exist (because you
      misspelled it, chose the wrong sprite/list, etc.) I know that it doesn't
      happen all the time - sometimes I get the "Property not found" error, which
      is a good thing, because it tells you very quickly where the problem is.
      But lately, I've been finding it's doing this skipping thing instead, which
      makes problems much harder to track down.


        • 1. Re: Bugs in Debugger
          Level 7
          1) Yes. That has been happening to me a lot in MX 2004. Don't know
          why. But if you click on the name of the handler above the current on in
          the handler stack on the left, then back on the current handler, it will
          usually jump to the correct line.

          2) Never seen this one

          3) This happens in Shockwave in a browser; I have never seen it in a
          projector. It is by design. It is a design decision that I disagree
          with, but nonetheless it is on purpose. The folks that set up shockwave
          decided that certain script errors should not throw an error dialog in
          the browser since it scares the end users (or some silly reason like
          that). So it will ignore the first 10 or so errors before actually
          crashing. And when it does that, it skips the rest of the handler just
          to make your life miserable. Personally, I think there should be a way
          to avoid that silly behaviour, like if the debugPlaybackEnabled is set
          for testing purposes, but there it is...
          • 2. Re: Bugs in Debugger
            Level 7
            > 1) Yes. That has been happening to me a lot in MX 2004. Don't know why.
            > But if you click on the name of the handler above the current on in the
            > handler stack on the left, then back on the current handler, it will
            > usually jump to the correct line.

            I'll try that next time it happens. (Of course, now it won't happen again,
            since I'm waiting for it... heh. Well, fine by me either way, I guess.)

            > 2) Never seen this one

            This one seems to occur sometimes when you delete a handler you're no longer
            using, or add a new handler before an existing one in a script, rather than
            after. It's like Director took a shortcut saying "Okay, this line here
            calls the third handler in such-and-such script", and when you do something
            that makes that handler now become the second or fourth, the places where
            it's called are not always updated to reflect that change until you
            save/quit/reload.

            > 3) This happens in Shockwave in a browser; I have never seen it in a
            > projector. It is by design. It is a design decision that I disagree with,
            > but nonetheless it is on purpose. The folks that set up shockwave decided
            > that certain script errors should not throw an error dialog in the browser
            > since it scares the end users (or some silly reason like that). So it
            > will ignore the first 10 or so errors before actually crashing. And when
            > it does that, it skips the rest of the handler just to make your life
            > miserable. Personally, I think there should be a way to avoid that silly
            > behaviour, like if the debugPlaybackEnabled is set for testing purposes,
            > but there it is...

            This is happening to me in *Authoring* mode. (In fact, all of these are in
            Authoring - there's no Debugger otherwise, of course.) I can sort of see
            (though not agree with) the logic for not displaying errors in Shockwave or
            Projector mode, but I would think in Authoring mode, you'd want to know
            immediately when there's an error, not 10 errors later. Does it really skip
            the first 10 errors? Wow, just imagining how much could go wrong before it
            tells you something in that case.


            • 3. Re: Bugs in Debugger
              Level 7
              "Darrel Hoffman" <no.address@all.com> posted in macromedia.director.lingo:

              > This one seems to occur sometimes when you delete a handler you're no
              > longer using, or add a new handler before an existing one in a script,
              > rather than after. It's like Director took a shortcut saying "Okay,
              > this line here calls the third handler in such-and-such script", and
              > when you do something that makes that handler now become the second or
              > fourth, the places where it's called are not always updated to reflect
              > that change until you save/quit/reload.

              (Re: above quote and point 3 from your OP)

              I hesitate to state the obvious, but since you didn't mention it... Have you
              recompiled all scripts after editing - or at least the current script? I know
              that not doing so can confuse the debugger in older versions.

              Also, when I developed one of my longer scripts, I seem to recall having to
              recompile, then "Remove all Breakpoints" prior to setting new breakpoints for
              it to work as expected - possibly with a Save As or a Save and Compact as
              well.


              --
              Mark A. Boyd
              Keep-On-Learnin' :)
              • 4. Re: Bugs in Debugger
                Level 7
                > I hesitate to state the obvious, but since you didn't mention it... Have
                > you
                > recompiled all scripts after editing - or at least the current script? I
                > know
                > that not doing so can confuse the debugger in older versions.
                >
                > Also, when I developed one of my longer scripts, I seem to recall having
                > to
                > recompile, then "Remove all Breakpoints" prior to setting new breakpoints
                > for
                > it to work as expected - possibly with a Save As or a Save and Compact as
                > well.

                Yes, I've definitely recompiled after editing. (Anyhow, it automatically
                recompiles everything when you hit the Play button, so that shouldn't be an
                issue.) As for breakpoints, I only use them when I'm trying to track down a
                problem. So most of the time, there aren't any breakpoints in any scripts.
                Of course, when this problem crops up, I'll probably end up throwing some
                breakpoints in there to try and see what happened, but of course by then the
                bug has already occurred, so the breakpoints are obviously not the cause. I
                haven't tried a Save As or Save and Compact, but for sure the regular Save
                doesn't work. When this one happens, save/quit/reload is the only option
                that's worked so far.