• 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: Help! program runs differently under debug than not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help! program runs differently under debug than not


  • Subject: Re: Help! program runs differently under debug than not
  • From: Eric Albert <email@hidden>
  • Date: Wed, 21 Jun 2006 15:26:24 -0700

On Jun 21, 2006, at 3:15 PM, Rick Mann wrote:

Once I solve this problem, the really hard one begins: trying to debug the child (gdb doesn't handle fork very well at all). I really need to be able to step through the child, and I don't know how I'm going to accomplish that. sigh

Someone described this earlier, but I'll try to make it a bit more clear. In the child, do something like this:


	int main(void) {
		static int foo = 0;
		while (foo == 0) {
			sleep(1);
		}
		...
	}

That'll cause the child to spin on startup. Attach with gdb, type 'p (foo = 1)' at the gdb prompt, and then go from there.

Hope this helps,
Eric

_______________________________________________
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: Help! program runs differently under debug than not
      • From: Rick Mann <email@hidden>
References: 
 >Help! program runs differently under debug than not (From: Rick Mann <email@hidden>)

  • Prev by Date: Help! program runs differently under debug than not
  • Next by Date: Re: Help! program runs differently under debug than not
  • Previous by thread: Help! program runs differently under debug than not
  • Next by thread: Re: Help! program runs differently under debug than not
  • Index(es):
    • Date
    • Thread