MacBook Pro
I got my work supplied MacBook Pro last week, and I've got two words... AWE-SOME! It's waaaay fast. On my dual 2GHz G5, Firefox bounces the dock icon about 5-8 times before opening. With the new universal Firefox binary, it bounces 1-2x on my MBP! That's friggin' fast! Now, I don't actually use Firefox (mostly because it's historically been too slow to start), but it's still an interesting measure.
Here's a few other interesting little tid-bits I came across on my first run through the new system:
- You can tell if an application is universal by looking at the "Get Info" window in the Finder, or by using the
filecommand from the Terminal. And you can tell if a process is actually running under Rosetta at runtime because/usr/libexec/oah/translatewill be mapped into its address space. Justlsof -p PID | grep translate
You can run an application under Rosetta from the command line by using the command/usr/libexec/oah/translate. For example:/usr/libexec/oah/translate /bin/ls
- On PPC functions arguments are passed in CPU registers starting with $r3. So, the function call
foo(1, 2, 3)would have0x1in$r3,0x2in$r4, etc. On Intel function arguments are passed on the stack, so the function callfoo(1, 2, 3)would have0x1at$ebp+8,0x2at$ebp+12, etc.
In Objective-C, a method call like[foo add:5]actually gets compiled into a C function call likeobjc_msgSend(self, @selector(add:), 5)
And as we just saw, Intel Macs pass function arguments on the stack. So, the standard way to print "self" ingdbon a PPC Mac ispo $r3
(remember,$r3has the first argument on PPC -- "self"), but on Intel it turns intopo *(int *)($ebp+8)
(poisprint-object).
If you need to debug (usinggdb) a PPC binary on an Intel Mac, you can do some basic stuff by setting theOAH_GDBenvironment variable toYES, then starting the application. Then in a new window, start gdb likegdb --oah
then use gdb'sattachcommand to attach to the running process like normal. This will even show you PPC style registers and stuff in gdb. Pretty cool for basic debugging.

