• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode debug follow fork
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode debug follow fork


  • Subject: Re: Xcode debug follow fork
  • From: Jim Ingham <email@hidden>
  • Date: Fri, 14 Nov 2008 10:29:13 -0800

You WOULD set "follow fork" by opening the Debugger console and typing "set follow-fork-mode child" IF this were supported in our version of gdb. But it is not (some kernel support we need to implement "follow fork" is not present in the Mach OS X kernel...)

If you don't mind attaching to your program after it has started up all the way and is sitting in its event loop, they you can run your command line, and then switch back to Xcode and use the Run->Attach To Process submenu you should see your process, and you can just attach to it.

If you need to attach to your process earlier than that, you can use gdb's "attach -waitfor" command which will get the debugger to cycle waiting for a process of a given name to show up, and when it does, to attach to it right away.

To use that in Xcode, open your Xcode project, edit the "active executable" (in Project->Edit Active Executable) switch to the Debugging tab, and uncheck "Start executable after starting debugger". Then start the Xcode debugger. Xcode will load your program into the debugger, but won't try to run it. So then you can open the Console (Run->Console) and type:

(gdb) attach -waitfor my_app

Then go to terminal & start up your app. Go back to Xcode and if the stars are correctly aligned, xcode should have attached to your program early in its startup code. Then you can continue from there and debug as you normally would.

Jim

On Nov 13, 2008, at 7:51 PM, Dee Ayy wrote:

I run my_app built in Xcode by invoking as follows from the terminal
(Terminal.app):
cat my_pipe | ./my_app

How can I debug this in Xcode?

Someone suggested that I debug the shell that I was about to run
my_app from, and set "follow fork".
I interpreted this as selecting from Xcode {Debug | Attach |
Terminal}.  But how/where do I set follow fork?  Then I assumed I'd go
back to the terminal and invoke my_app.

Thanks.
_______________________________________________
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

_______________________________________________ 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
  • Follow-Ups:
    • Re: Xcode debug follow fork
      • From: "Dee Ayy" <email@hidden>
    • Re: Xcode debug follow fork
      • From: "Dee Ayy" <email@hidden>
References: 
 >Xcode debug follow fork (From: "Dee Ayy" <email@hidden>)

  • Prev by Date: Re: xcode error and warning display...
  • Next by Date: Re: Determining GUI ivar assignments in IB
  • Previous by thread: Xcode debug follow fork
  • Next by thread: Re: Xcode debug follow fork
  • Index(es):
    • Date
    • Thread