QC Leopard Changes (under-the-hood edition)

cwright's picture

QC Leopard has had some pretty rad changes, both internal and external. The external ones get documented well, and everyone can see them anyway. The internal changes, however, aren't as apparent. Since there are a couple noteworthy changes I've noticed already, I figure I'll jot them down here for reference.

zeroth: Enable hidden patches like this now: defaults write -g QCShowPrivatePatches 1

(I think others have already found this though)

First: tons of Objective-C 2 trickery trips up gdb (some by design?). In QCTiger, you could do b -[GFNodeManager registerNodeWithName:] and you'd break on each registration. With QCLeopard, this apparently no longer works. I can't tell if this is a function of OC2, or if QCLeopard's binary is modified. Basically, gdb can't find an address when provided with a method name. breaking on the address (b *0x922db74c) still works though. I guess I'll have to make a method->address table now (probably not appropriate to make public). Snippet to get a method's address:

  • Method m = class_getInstanceMethod([myObject class], @selector(someSelector));
    NSLog(@"method address: 0x%016x",method_getImplementation(m));

This piece works within a plugin (look at that raw offset, what a hack! :) -- not 64bit safe.

   void* m = (void*)class_getInstanceMethod([GFGraphView class], @selector(boundsForNode:));
   unsigned int *ma = m;
   NSLog(@"method address: %08x",ma[2]);

Second: QC notices when plugins crash, and tells the user that it was possibly the plugin's fault. This is pretty slick :)

Third: it's still 32bit... but plugins have 64bit versions... it'll be interesting to see how this works out (for now, most binaries appear to be 32bit.)

Fourth: related to point 1, the QC framework taints the runtime to report garbage for all the convenience gdb commands I've used to reverse QC, making it considerably more difficult... holy cow. For example, the QCRenderer object's internals now report nothing for classNames, except for one, which unhelpfully reports 'NSObject'. argh. [Edit: This may be caused by stripped binaries, or possibly by OC2 runtime tricks, or even possibly by OC2's new object model. I'm leaning towards number 3 now, followed by number 1, but I've seen a few places where number 2 was used even in QC Tiger.]

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

sbn..'s picture
And the external ones?

Thanks, cwright. Do you have any links or info on a feature list of the external changes you mentioned? I haven't rushed out and gotten Leopard for my old G4 (figure I'll need a whole new computer within a year). I'm trying to figure out if it's worth it - mainly because of QC, but I haven't seen any in-depth coverage of QC Leopard.

cwright's picture
External Changes

for the externals, I'll defer to Alessandro Sabatelli's Mailinglist coverage, found at http://lists.apple.com/archives/quartzcomposer-dev//2007/Oct/msg00077.html

The release notes bundled with QC are also pretty enlightening. Here are some highlights with my notes:

1.0 Redesigned Image Pipeline -- mostly internal. 1.1 Composition Repository -- QC's way more integrated. There are some special bindings between QC and FinalCutPro, as well as FX (from what we've discovered by exploring). Not sure how this will be used, but it looks quite exciting :) 1.2 Support For Virtual Patches -- compositions can now pose as Patches in other compositions. 1.3 -- keyless structures (arrays, kind of), and closed loops in the graph are now allowed.

Unlimited workspace size. There are overall a ton of UI improvements (scroll-wheel can zoom in/out, double click to edit properties like title, others)

QCLeopard can also simulate QCTiger's runtime environment, and show you incompatibilities and other changes between the two. This is pretty slick for 10.4/10.5 compositions. I've heard of some mixed results with using it though, so keeping Tiger around for a while can't hurt.

Quartz Composer Visualizer -- a tool that can display compositions across multiple computers and multiple screens. I think there was a WWDC demo or something that used this (I saw pictures)

Lots of programming stuff to integrate QC into other apps.

Loading a composition from data is now externalized through QCComposition (so no more needing to hack in this functionality like in Tiger)

sbn..'s picture
Thanks once again,

Thanks once again, cwright!

That looks promising, especially Timeline sounds great. I'll look over this list.

After that I'll hope that some video examples will eventually be posted, and coverage from something like createdigitalmotion (if they even have someone knowledgeable on QC on staff).

Leopard suddenly looks very tempting...