PDA

View Full Version : gdb failure to launch




devdog
Jun 13, 2011, 03:49 PM
Xcode version 3.1.3 Debugger Console reads:
/bin/sh: line 0: exec: arch: not found
when attempting to launch a debug build of a simple command line application with a single breakpoint. Has anyone else had this happen?



numero
Jun 14, 2011, 10:01 PM
I'm on Intel and don't have a version of Xcode that can generate PPC code so I can't test this, but my first guess is that your target architecture isn't compatible with your current processor. My guess is you are on a PPC machine and you have only Intel builds selected.

Complete shot in the dark on this one.

devdog
Jun 15, 2011, 08:18 AM
My fault you're in the dark about host and target architecture - I should have mentioned that both are Intel. I still don't know the original cause but got around the problem by adding set start-with-shell 0 to my .gdbinit file.

numero
Jun 15, 2011, 11:56 PM
I didn't mean "shot in the dark" in the way that you didn't provide enough information in your original post. I probably wouldn't have thought to provide architecture info if I was reporting this problem. I meant it in the way of -- I've never encountered this problem, but if I did what might have caused it. I was making more of an educated guess than giving a solution from experience.

These "But that shouldn't happen" things are hard ones to figure out. Glad you found something to get around the problem.

jiminaus
Jun 16, 2011, 01:52 AM
My fault you're in the dark about host and target architecture - I should have mentioned that both are Intel. I still don't know the original cause but got around the problem by adding set start-with-shell 0 to my .gdbinit file.

If you're having to avoid the shell, perhaps there's a problem if your shell setup.

If you open Terminal and run the following command, what do you get:

echo $PATH

devdog
Jun 16, 2011, 10:07 AM
If you open Terminal and run the following command, what do you get:

echo $PATH


I get: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin.