xcode gdb 声称它不知道如何运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4917377/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
gdb claims it doesn't know how to run
提问by Peter Hosey
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.
我在 Mac Pro 上的 Mac OS X 10.6.6 上使用 Xcode 3.2.3 来构建来自 Growl -development repository的 GrowlTunes 的修订版 5fd480ef577f 。
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.
当我在 Xcode 中尝试时,它显然做了一些失败的内部测试,因为它甚至没有将 GDB 列为一个选项。由于 Cocoa 应用程序没有其他调试器(在这个版本的 Xcode 中),目标信息窗口中与调试相关的弹出菜单是空的,并且尝试运行应用程序没有任何作用——运行按钮切换回立即运行按钮。
The target is built for 32-bit PowerPC and 64-bit Intel:
目标是为 32 位 PowerPC 和 64 位 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.
我可以直接从终端或 Finder 运行它,但这对我的逐步调试没有帮助。
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.
这不是交叉编译场景;我的意思是运行 64 位 Intel 架构,这是我机器的本机架构,而不是 PowerPC 架构。
I'm guessing this is some build misconfiguration somewhere in the project, but I've no clue what or where. Any suggestions?
我猜这是项目中某处的一些构建错误配置,但我不知道是什么或在哪里。有什么建议?
采纳答案by Peter Hosey
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.
在相关构建设置中切换架构的顺序解决了 gdb 和 Xcode 中的问题。这是一个蹩脚的解决方案,我仍然欢迎更好的解决方案,但至少它有效。
回答by Peter Hosey
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.
我仍然很感激能够让我在 Xcode 中运行/调试应用程序的解决方案。
回答by AntoineL
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)
在 gdb 提示符下,尝试 'set arch x86_64' 或 'set arch i386:x86-64'(当然没有引号;我是 gdb 的新手,我正在寻找其他问题的解决方案)