Chris Quenelle's Weblog
Thoughts on developer tools.

All | Dbx | Development Tools | Life in General | OpenSolaris | plus | Software Philosophy | Sun Studio

fav comics

« Previous day (Dec 6, 2005) | Main | Next day (Dec 8, 2005) »
20051207 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:

  1. 1. Start up the IDE
  2. 2. make sure the "Local Variables" window is showing
    (The icon for it is the green square tipped on its corner)
  3. 3. quit the IDE

For each use:

  1. 1. start up IDE
  2. 2. Load a program to cause a dbx session to start
  3. 3. close the Local Variables window
  4. 4. continue debugging
  5. 5. When you're ready to quit, turn the Local Variables window back on
  6. 6. quit the IDE

(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 - -

Older blog entries:

mug shot Chris Quenelle is a tools developer at Sun Microsystems. He's worked on performance and debugging tools at Sun for more than 10 years. He reads comic books and science fiction, and has more tivos than he can keep track of.

Calendar

RSS Feeds

Search

Links

Navigation

Referers