Mac OS X调试错误

时间:2009-12-17 15:30:44

标签: macos gdb

在使用gdb启动我的应用程序时,我遇到了奇怪的错误:

unable to read unknown load command 0x22

整个跟踪看起来像这样:

[Session started at 2009-12-17 10:28:24 -0500.]
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".tty /dev/ttys003
Loading program into debugger…
sharedlibrary apply-load-rules all
warning: Unable to read symbols for "@loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle" (file not found).
warning: Unable to read symbols from "Sparkle" (not yet mapped into memory).
unable to read unknown load command 0x22
unable to read unknown load command 0x22
Program loaded.
run
[Switching to process 9051 local thread 0x2e03]
Running…
unable to read unknown load command 0x22
unable to read unknown load command 0x22

我已尝试过各种可用的分析工具,无法找到任何内存泄漏或任何可能导致这些未知错误的内容。

帮助?

1 个答案:

答案 0 :(得分:1)

这个问题有两个部分修复。

确保您在Copy Frameworks构建阶段进行Sparkle复制。

其次,在Copy Frameworks之后将以下脚本添加为buildphase有助于修复某些计算机上的加载路径。

install_name_tool -change "@loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle" "@executable_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH"

下面是我的项目中这个buildphase的截图。

Build Phase Example http://grab.by/1OkU

这是我目标步骤的截图。

Target Steps http://grab.by/1fCu