Do not envy the folks working on mach_inject for Intel, for they shuttle strange rocks up steep hills.  The PPC mach_inject, originally written by a really fabulous cat called Jonathan "Wolf" Rentzsch, can assume (thanks to the RISC instruction set of the PPC) that instructions are of fixed-length.  Our new macintels have the advantage/disadvantage that comes with instructions of variable length (wikipedia: RISC CISC).  The genius of mach_inject just got a whole lot harder to implement because running that first injected bit of code now requires some mechanism for knowing how long it is other than "it's this.  always."  The good news is that "Wolf" and co. appear to be approaching a solution!  It also looks like the "Wolf" part of that equation is going to find some time to chew on this problem soon.  He's rather in demand these days... 

We wait, but we probably won't wait long.  :)


PS -
Right now we'll stay the course with instruction overwriting, but be 
aware we have instruction insertion in our back pocket if x86
hack-arounds sufficiently pisses us off.
" - Jonathan "Wolf" Rentzsch on
On 5/9/06, Ronald Oussoren <> wrote:

On 9-mei-2006, at 12:18, ytrewq1 wrote:

> Thanks to the help I received here, I've gotten most of my plug-ins
> working as Universal binaries.  One of the remaining ones is basically
> a wrapper around a couple of the Inject examples.  I get the following
> error when I try to run the examples:
> NotImplementedError: objc.inject is only supported on Mac OS X 10.3
> and later

That message isn't entirely true anymore, objc.inject also isn't
supported on x86 systems. I disabled it when I did the initial port
and haven't looked at it afterwards because I don't use the
functionality myself.

IIRC mach_inject doesn't work on darwin/x86 unless you have special
privileges (aka "you're root"). Independent of this someone would
have to write the assembly
code that is used as the stub that is injected into the host
application. I've seen enough assembly code while porting libffi, and
my assembly skill isn't good enough to actually do the work anyway.

However, it seems a port of mach_inject (which objc.inject wraps) to
intel is in progress (see the extendamac archives at http://, maybe we can
use that whenever it is finished.

> I take it this is related to what is mentioned about mach_inject at:

Not really.
> Is there any hope of getting this to work?  I've found the inject
> interpreter
> functionality to be a great help in developing plug-ins as the
> number of
> times I restart the host application has been reduced tremendously
> and the
> interactive development style enabled is a big plus.
> Is the following relevant to this issue?

I cannot comment on this page because I cannot open this URL (server
stops responding).


> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services,
> security?
> Get stuff done quickly with pre-integrated technology to make your
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> _______________________________________________
> Pyobjc-dev mailing list

The extent to which an individual can resist being blindly led by tradition is a good measure of his vitality.  - Harry Partch

There is a computer disease that anybody who works with computers knows about. It's a very serious disease and it interferes completely with the work. The trouble with computers is that you 'play' with them! - Richard P. Feynman

Few people are capable of expressing with equanimity opinions which differ from the prejudices of their social environment.  Most people are not even capable of forming such opinions.  - Einstein