On Sep 9, 2008, at 4:04 PM, Pat McGee wrote: Thanks to your explanation, I'm more clear on what gets debugged. What I still don't know is how to set up the executables I need.
1) When you say "set the Active Executable to the executable you wish to debug", I don't see what user actions I could take to do that. I see two things I can choose: Active Target, and Active Build Configuration. When I open the Debugger console and mouse-down on Overview, I see choices for Active SDK, Configuration, Target, Executable, and Architecture. Of these, I have two choices on all except Executable, where I have only one choice.
That's fine. Xcode will only automatically create executables for code that can be run; "MyProject" sounds like the name of your application. Unit tests can't be run by themselves — they're just a bundle, not an application or command-line tool — so you won't have an automatically-created executable for them.
This might be because I see another issue:
2) I have only one executable. That is, in the Smart Group "Executables", there is only one thing, which is "MyProject". This is the one in whose Info window I set the argument "-SenTest All" and the four environment variables: DYLD_FALLBACK_FRAMEWORK, DYLD_INSERT_LIBRARIES, XCInjectBundle, and XCInjectBundleInto.
If I'm supposed to have two different executables, then I don't know how to create a second one. I've reviewed the instructions that I thought were relevant, and if it's in there, then I didn't understand it.
There are not instructions to create a separate executable. I thought, given what you were saying, that you might have created a separate executable at some point specifically for testing.
(Per your suggestion, I did check the debugger console again, and verified that there really were no error messages.)
OK, does that help pinpoint what I got wrong?
Unfortunately, it does not.
Please take another look at the arguments and environment variables in your executable. They should look like this:
Arguments: -SenTest All
Environment variables:
DYLD_FALLBACK_FRAMEWORK_PATH = $(DEVELOPER_LIBRARY_DIR)/Frameworks DYLD_INSERT_LIBRARIES = $(DEVELOPER_LIBRARY_DIR)/PrivateFrameworks/DevToolsBundleInjection.framework/DevToolsBundleInjection
XCInjectBundle = $(BUILT_PRODUCTS_DIR)/MyTests.octest
XCInjectBundleInto = $(BUILT_PRODUCTS_DIR)/MyProject.app/Contents/MacOS/MyProject
How do your arguments and environment variables differ from this?
Are your unit tests actually being run during your build, at least? P.S. When I get this right, I want to post a set of detailed user actions and a skeleton project. I like making the trail nicer for people who come after me. And I really appreciate you breaking the trail for the rest of us. P.M.
The instructions I posted should be reasonably complete, though obviously they lack screen shots or anything. Bill Dudney also posted a walkthrough with screen shots:
It uses Xcode 3.0, rather than Xcode 3.1, but it should be straightforward to follow. Xcode 3.1 fixes the problem where you needed to add "set start-with-shell 0" to your ~/.gdbinit file, so ignore the "Configure GDB" section of his post. It does that by introducing the XCInjectBundleInto environment variable, in which you need to supply the full path to the application you're testing.
(Also, I'm not breaking the trail. I work on Xcode, so it's more like I put together the trail several years ago, and quite a few people have walked it since. Thanks, though! :)
-- Chris
|