Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdb claims it doesn't know how to run

I'm using Xcode 3.2.3 on Mac OS X 10.6.6 on a Mac Pro to build revision 5fd480ef577f of GrowlTunes from the growl-development repository.

With a clean build from a virgin checkout, this is what I get:

% gdb build/Debug/GrowlTunes.app/Contents/MacOS/GrowlTunes 
GNU gdb 6.3.50-20050815 (Apple version gdb-1469) (Wed May  5 04:41:34 UTC 2010)
[blah blah blah]
This GDB was configured as "--host=x86_64-apple-darwin --target=powerpc-apple-darwin"...Reading symbols for shared libraries ......... done

(gdb) run
Starting program: /Volumes/RAM Disk/growl-development/Extras/GrowlTunes/build/Debug/GrowlTunes.app/Contents/MacOS/GrowlTunes 
Don't know how to run.  Try "help target".

When I try it in Xcode, it apparently does some internal test that fails, because it doesn't even list GDB as an option. Since there are no other debuggers (in this version of Xcode) for Cocoa applications, the pop-up menus related to debugging in the target Info window are empty, and attempting to run the app does nothing—the Run button switches back to being the Run button immediately.

The target is built for 32-bit PowerPC and 64-bit Intel:

% file build/Debug/GrowlTunes.app/Contents/MacOS/GrowlTunes 
build/Debug/GrowlTunes.app/Contents/MacOS/GrowlTunes: Mach-O universal binary with 2 architectures
build/Debug/GrowlTunes.app/Contents/MacOS/GrowlTunes (for architecture ppc7400):        Mach-O executable ppc
build/Debug/GrowlTunes.app/Contents/MacOS/GrowlTunes (for architecture x86_64): Mach-O 64-bit executable x86_64

I can run it directly, either from the terminal or from Finder, but that doesn't help me step-by-step debug.

This isn't a cross compilation scenario; I mean to run the 64-bit Intel architecture, which is my machine's native architecture, not the PowerPC architecture.

I'm guessing this is some build misconfiguration somewhere in the project, but I've no clue what or where. Any suggestions?

like image 343
Peter Hosey Avatar asked Oct 18 '25 14:10

Peter Hosey


1 Answers

Switching the order of the architectures in the relevant build setting fixed the problem both in gdb and in Xcode. This is a lame solution, and I'd still welcome a better one, but at least it works.

like image 52
Peter Hosey Avatar answered Oct 21 '25 12:10

Peter Hosey