Flex 2 has launched! What’s new in the debugger since Beta 3
An exciting, exciting day!
As for the Flex Builder debugger: Other than bug fixes, there is one tiny new feature in the debugger since Beta 3. Sometimes, when looking at source code, it isn't obvious which lines you can actually set a breakpoint on. For example:
function f(z:int):void // can you set a breakpoint on this line? { // this one? var i:int; // this one? trace( // this one? z // this one? ); // this one? } // this one?
The answers depend on how the compiler does its work, and figuring out those answers requires tedious trial and error. It's not something people should have to think about.
So, to make life easier for the user, we made a small change: If you set a breakpoint but it turns out that there is no actual code on the line you specified, then we scan down a few lines (ten, actually) to see if we can find a line that has code on it. If we do find such a line, then we move your breakpoint there.
If you set a breakpoint while in the middle of a debugging session, the breakpoint is adjusted immediately. If you set a breakpoint before you have started your debugging session, then the breakpoints are initially left where you put them, but are then adjusted when you actually begin the debugging session (click "Debug").
Sometimes my favorite features are the ones that transparently "just work," solving a problem so quietly that the user doesn't even realize the feature it there. It's a beautiful thing, because it makes the user's life a little easier, but without giving him something extra to have to think about. There is no "We've moved your breakpoints" message; that would just distract and worry the user.
Many congrats Mike! The debugger is certainly one of my favorite features of FB. I’ve been waiting a long time for the day when we’d have a real debugging environment.
Hi Mike!
I am running on the production version of Flex 2.0, and for some reason the debugger seems to have stopped working for me. It just blows by all my breakpoints. I know the code is hitting the breakpoints, because I put some alerts in there. But in debug mode, it just cruises on by without stopping.
I cannot fathom why. One thing I did, and I have no idea whether this has anything to do with the problem, but I kept on forgetting to stop a debugging session before starting a new one. So I finally answered in the affirmative when it asked me whether I wanted it to stop an active debugging session automatically before starting up a new one. I also can’t figure out how to undo this setting, so that I manually have to stop each debugging session again.
–Lisa
Hang my head in shame. Just found this FAQ:
“The safest way to set breakpoints in component files is to use the Files list. Start the debugging session, navigate in your application to where you want to start debugging. Click the Files button on the Debug Toolbar (select Menu Debug > Files). Select the component you want, usually the MXML or ActionScript files.
The list strips out underscores in filenames and can be very long, but this method always works. Flex Builder will open a temporary file and set the breakpoints. Now you can proceed.”
I’ll bet this is my problem.
–Lisa
Lisa,
The FAQ you mention in your second comment applies only to Flex Builder 1.5, not to Flex Builder 2.0, which is a completely new code base. Sorry the FAQ wasn’t clear about that.
Go to this “Known Issues” page and then scroll down to “ActionScript Debugger” — the first item there may be your issue:
“The debugger doesn’t stop at breakpoints when using <script src=”XXX”> to point to files located in subfolders - The workaround is to temporarily move your scripts out of the subfolder or to put them inline in a Script block in the MXML file.”
If that is not the issue, then please post a message to the Flex Builder 2 discussion forum — that forum is watched by employees as well as by other users. Thanks!
I have also had this issue and finally found a solution. Recently, Flex had started failing to stop and breakpoints in files in the build path (i.e., not directly in the project). After searching through all of the settings for anything out of place, I decided to remove all entries in my project’s build path as well as their corresponding copies in the project bin directory. Once I added the build path entries back, breakpoints once again worked.
Flex Builder 2 seems to have several of these types of issues with strange behavior relating to files external to the project.