Xcode 2.2 Quickies

November 10th, 2005

I’m excited to see Xcode 2.2 unleashed for the world to enjoy. I’ve been using a pre-release of it for a week or two, and have been itching to share some of the less obvious improvements I’ve noticed in this release.

GDB’s Info Shared Command

Yee haw! How cool is this? The bug I described in this blog entry a while back is fixed! You can now use the powerful “info shared” command on variable arguments, for instance “info shared $pc” to see which library you’re currently stepping through.

Xcode’s Object File Targets

Xcode now supports a very convenient target type that bridges the gap between static libraries and dynamic libraries. With an “object file” target, you get all the export encapsulation offered by a framework, with the flexibility of compiling and linking afforded to static libraries.

For example, if somebody throws a pile of code your way that needs to be statically linked against your project, you can use the object file target to safely sequester all the symbols from that set of files into a single module that is linked with your existing code base. This is a real boon to avoiding conflicting symbols that may have otherwise needed to be marked as “exports” in a static library, in order to keep inter-module linkage working.

CHUD Tools “hwprefs” Permissions

On a less ecstatic note, the latest version of CHUD Tools includes a change in the security model surrounding the “hwprefs” command. In the past, anybody could use this command to, say, turn off CPU napping. If you’ve got a chirpy G5, you’re no doubt familiar with using this technique to work around the noise problems. Starting with this edition of CHUD Tools, if you’ve got a startup script designed to perform this task after every reboot, you’ll notice that it fails with a permission error.

A very helpful Apple employee pointed out that I can get the old behavior back by simply setting the sticky bit on the (root owned) hwprefs command:

sudo chmod ug+s /usr/bin/hwprefs.

Summary

Lots of great working coming out of the Xcode group. They are responsive and seem to be sensitive to the issues that really affect us developers. I’m looking forward to finding more happy (and hopefully no unhappy) surprises in the weeks to come.