• 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: need way to debug tool called by popen--at startup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: need way to debug tool called by popen--at startup


  • Subject: Re: need way to debug tool called by popen--at startup
  • From: Jim Ingham <email@hidden>
  • Date: Thu, 30 Apr 2009 10:45:27 -0700

follow-fork doesn't work on Mac OS X.

But as long as your machine isn't too heavily loaded, --waitfor will stop you very early in the dyld loading process, so you can catch most startup bugs this way.

Jim

On Apr 30, 2009, at 10:17 AM, Alastair Houghton wrote:

On 30 Apr 2009, at 18:08, Jonas Maebe wrote:

On 30 Apr 2009, at 18:35, Dennis Christopher wrote:

The problem I have is I want to debug an exception that occurs near
to the startup of the tool, and by the time I go through the Attach step back in XCode the tool
is already past that point. Perhaps there is a way with gdb to do this...? any suggestions would be
appreciated.

gdb -waitfor <processname>

(note that this works via some polling method)

Alternatively, you can add a sleep(10) or however long you need at the beginning of the command line tool, so that you do get enough time to attach gdb manually.

If it works on Mac OS X (and I have no idea if it does), you might also be able to use GDB's follow-fork-mode for this purpose. Probably not a good idea from the Xcode debugger though, as if it does work it's liable to confuse Xcode (i.e. run GDB in Terminal instead).


Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________
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
References: 
 >need way to debug tool called by popen--at startup (From: Dennis Christopher <email@hidden>)
 >Re: need way to debug tool called by popen--at startup (From: Jonas Maebe <email@hidden>)
 >Re: need way to debug tool called by popen--at startup (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: Determine nested return value from asm in debugger
  • Next by Date: Re: Xcode could not locate source file
  • Previous by thread: Re: need way to debug tool called by popen--at startup
  • Next by thread: Re: need way to debug tool called by popen--at startup
  • Index(es):
    • Date
    • Thread