Re: breakpoints in helper tool stay pending
Re: breakpoints in helper tool stay pending
- Subject: Re: breakpoints in helper tool stay pending
- From: Ken Thomases <email@hidden>
- Date: Sun, 3 Jan 2010 18:03:03 -0600
On Jan 3, 2010, at 11:54 AM, James W. Walker wrote:
> I have an Xcode 3.2.1 project with 2 targets, a Cocoa app and a command line helper tool that is run using NSTask. The problem is that breakpoints in the helper stay pending (orange arrow, gray text in the breakpoints window) even after the helper has started. I made sure that the helper is set to generate full debug symbols, in dSYM form. It doesn't matter whether "Load symbols lazily" is on or off. I couldn't find any sample code illustrating the situation of a project with an app and a helper tool. Is it supposed to work?
Xcode can only debug one process at a time. Assuming you're launching the application via the debugger, then Xcode won't be debugging the helper tool. The breakpoints stay pending because they don't correspond to the process being debugged.
You can have Xcode attach its debugger to the helper tool, but to do that a) the helper tool would have to live long enough to get attached to, and b) Xcode would have to not be debugging the main app at the time. To solve (a), you can insert a deliberate pause (or even stop using raise(SIGSTOP)) into the helper tool's code, so that it waits for the debugger to be attached.
For (b), you can execute a second instance of gdb directly, in addition to the one that Xcode uses to debug the app. You can use the techniques described here <http://developer.apple.com/mac/library/qa/qa2007/qa1573.html> to attach gdb to your helper tool as or soon after it is launched. Of course, with this approach, you are dealing with gdb directly without the Xcode GUI on top. That can be both more powerful and less convenient.
Cheers,
Ken
_______________________________________________
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