开发者

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 configur开发者_JS百科ed 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?


Workaround from a contact of mine:

gdb -arch x86_64 build/Debug/GrowlTunes.app/Contents/MacOS/GrowlTunes

I'd still appreciate a solution that would enable me to run/debug the app in Xcode.


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.


At gdb prompt, try 'set arch x86_64' or 'set arch i386:x86-64' (without quotes of course; I am a total newbie with gdb, I am lurking for solutions for other problems)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜