0

I'm trying to compile this simple application for powerpc-apple-darwin on Snow Leopard. I've installed Xcode 3.2.6.

prog.c:

#include "sys/proc.h"


main()
{
    ptrace (0xE, 1, 0, 0);
}

I'm compiling from the command line like so:

/Developer/usr/bin/powerpc-apple-darwin10-gcc-4.2.1 prog.c -I /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers

It compiles fine but when I try to run it I get illegal instruction. Any ideas?

# int __cdecl main(int argc, const char **argv, const char **envp)
.globl _main
_main:
mflr      r0
stmw      r30, -8(r1)
stw       r0, 8(r1)
stwu      r1, -0x50(r1)
mr        r30, r1
li        r3, 0xE       # request
li        r4, 1         # pid
li        r5, 0         # addr
li        r6, 0         # data
bl        _ptrace
lwz       r1, 0(r1)
lwz       r0, 8(r1)
mtlr      r0
lmw       r30, -8(r1)
blr
# End of function _main
AnArrayOfFunctions
  • 3,452
  • 2
  • 29
  • 66
  • What are you expecting this to do? This is a very odd ptrace request… –  Aug 09 '17 at 03:05
  • Also: what platform are you executing this code on? PowerPC with an earlier version of the OS, or on 10.6 with Rosetta? –  Aug 09 '17 at 03:10

0 Answers0