Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debug 'fork' with Xcode and continue in child



set follow-fork-mode is not implemented on Mac OS X (it was only very recently implemented on Linux). We'll get to it some day...

But for the present, the best way to do this is to put something like:

    {
      int i = 1;
	  while (i) { ; }
    }

in your client's main, and then attach with gdb, set i to 0, and continue.

You can attach in Xcode by turning off the "Start executable after starting debugger" checkbox in the Executable editor for your target, then doing:

(gdb) attach <PID>

in the gdb console.

If there is only one copy of an app running, you can just type:

(gdb) attach Name

and that will work as well.

Jim

On Oct 20, 2004, at 10:32 PM, Dominik Pich wrote:

I have a unix source which forks right at the start. Xcode continues in parent then... and therefore exits.
Can I somehow debug the client with a GUI?


Thought I found it:
set follow-fork-mode mode
Set the debugger response to a program call of fork or vfork. A call to fork or vfork creates a new process.
but it isnt working...


May you always find water and shade. - Wheel Of Time
Dominik

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >Debug 'fork' with Xcode and continue in child (From: Dominik Pich <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.