gdb failure to launch

Discussion in 'Mac Programming' started by devdog, Jun 13, 2011.

  1. devdog
    Expand Collapse
    macrumors newbie

    Joined:
    Jun 13, 2011
    #1
    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?
     
  2. numero
    Expand Collapse
    macrumors regular

    Joined:
    Jul 23, 2002
    Location:
    OR
    #2
    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.
     
  3. devdog
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Jun 13, 2011
    #3
    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.
     
  4. numero
    Expand Collapse
    macrumors regular

    Joined:
    Jul 23, 2002
    Location:
    OR
    #4
    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.
     
  5. jiminaus
    Expand Collapse
    macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #5
    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:
    Code:
    echo $PATH
    
     
  6. devdog
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Jun 13, 2011
    #6
    I get: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin.
     

Share This Page