Re: Fun with fork/exec in the XCode debugger
Re: Fun with fork/exec in the XCode debugger
- Subject: Re: Fun with fork/exec in the XCode debugger
- From: Jonas Maebe <email@hidden>
- Date: Wed, 15 Feb 2006 10:01:10 +0100
On 14 feb 2006, at 22:33, Timothy Standing wrote:
I have several functions in a statically linked library which use
fork/exec to call some command line tool to perform some work.
They use fork/exec and then call waitpid, WIFEXITED and WEXITSTATUS
to wait for the child process to end and then retrieve its status.
These calls all work fine when I run the debug build of my product
by launching it in the Finder. When I run it from the XCode 2.2
debugger, however, I get results from WIFEXITED and WEXITSTATUS
which don't make any sense.
Just a quick remark: if you're only forking to exec something, use
vfork() instead of fork(). The performance difference is immense,
because memory map copying is very expensive on Mac OS X (and the
bigger the memory map is, the more expensive it becomes). I sped up
compiling our compiler with itself by 25-30% by simply replacing fork
with vfork in the routine which calls the assembler (which only
happens 157 times in the process of compiling 150kloc divided over
157 compilation units)
On the other hand, that may confuse the debugger even more :)
Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden