Wednesday December 07, 2005

Sun Studio IDE -- turning off locals
The IDE in Sun Studio 11 (based on NetBeans 3.5) has problems sometimes when it asks dbx to print variable values. At the bottom are some instructions to work around this problem. But first I'll explain a little bit about the bug.
If you are running command line dbx and you encounter a bug when printing something out, it's usually not a big deal. You get an error or warning, and you go on. (Hopefully, you post a message in the dbx forum so that we can make sure we get it fixed in the next release.)
In the IDE problems are made worse. The IDE has a "locals" window which displays all the local variables in the current function. This window is updated whenever you stop in a function, or whenever you use the step or next buttons.
This means that if you run into a printing problem in dbx, you'll see the same error every time you single step (for example). Sometimes the IDE might even crash in response to this kind of problem. (Please let us know when you see a crash.)
If you run into such a bug, the first thing you want to do is turn off the part of the IDE that reads all the locals from dbx every time it stops. That will allow you to narrow down which variable is causing the problem, and stay away from it.
Here the situation is complicated by an additional bug in the NetBeans Debugger Core module. The additional problem is that even though the locals window may be turned off, the IDE might still send queries to dbx to retrieve the values of the local variables.
The IDE has to see you turn off the locals window in order to cancel the updates from dbx. If the locals window starts out closed, then the IDE will still request updates from dbx.
The workaround has a setup step and something to do each time you use Sun Studio.
Setup:
For each use:
(I had some trouble formatting those lists, if you see two copies of the numbers let me know.)
Yes, we know this is a pain in the butt. Especially remembering to turn the locals window back on before you quit the tool. We're planning on making a Sun Studio 11 patch to add a more convenient disable switch. For architectural reasons, it was a difficult bug to fix because it's inside the NetBeans platform code. When we update to the next version of the NetBeans platform, it won't be a problem.
Remember! If you don't happen to run into any dbx problems related to printing variables, then there is no reason to use this workaround. The process described here is only needed to prevent a mild dbx bug from making the IDE unusable.
Posted by Chris Quenelle ( Dec 07 2005, 07:50:58 PM PST ) - Permalink - - Sun StudioOlder blog entries: