Debugging or Watching Static Variables within Flash Builder 4
Problem:
When I set a breakpoint and debug my application, Flash Builder 4 is not displaying static variables within the variables window. I can't seem to find a solution in other posts.
More detail:
I'm using flash builder 4 to execute flex unit tests on one of my AS3 classes. I set a static variable within the [Before] function, which is accessed in each of the tests.
I've set a breakpoint within one of the tests to see why it is failing, but I notice that static variables don't appear when I expand the 'this' object within the variables window. (In this case my static variable is the only variable associated with the class, so the only object in the variables window is the "this" object).
Question: Does anybody know how to make static variables appear in the variables win开发者_如何学Pythondow?
Thanks,
Cookie
True, the Variables panel only shows non-static variables in scope.
BUT, you can use the Expressions panel to keep an eye on those static variables... even if they are private. Just type YourClass.staticVariable into a new Expression row, and it will watch your statics for you no problem at all.
You can also hover your mouse over the static variable and a tooltip will appear with the value.
Just for fun, I compared it to Visual Studio. The comparable panel is called "Locals" over there, and it DOES let you see static members while looking at instances... so, using VS as a precedent, you are not out of line for thinking that you might be able to do this in FB. But alas, use "Expressions" instead.
:)
There's a filter for the variables view that determines what you'll see. On the top right of the variables panel is a menu button (the icon is an upside down triangle), click that, choose Flex from the drop-down and select 'Show Inaccessible Member Variables'.
Cheers!
I'm on Flash Builder 4.7 and none of the answers given by K0j0 and Brian Genisio applies. So far the only way I can debug a static variable is by assigning it to a local variable (thus had to modify the code). Hope there's a better way of doing this somehow
精彩评论