I'm using Xcode 4.3.2 with lldb as my debugger.
我正在使用Xcode 4.3.2和lldb作为我的调试器。
I have inherited a project that contains code that is calling UIKit from secondary threads, as shown by these log messages:
我继承了一个项目,其中包含从辅助线程调用UIKit的代码,如这些日志消息所示:
2012-05-02 21:48:14.603 Appname Dev[77594:16e0f] void _WebThreadLockFromAnyThread(bool), 0x8d5f810: Obtaining the web lock from a thread other than the main thread or the web thread. UIKit should not be called from a secondary thread.
2012-05-02 21:48:14.603 Appname Dev [77594:16e0f] void _WebThreadLockFromAnyThread(bool),0x8d5f810:从主线程或Web线程以外的线程获取Web锁定。不应该从辅助线程调用UIKit。
I have cleaned up most of the code that was making UIKit calls from secondary threads, but I am still occasionally seeing this message in the logs. The app is not crashing, so it's difficult to pinpoint where the problem lies.
我已经清理了从辅助线程进行UIKit调用的大部分代码,但我偶尔会在日志中看到此消息。该应用程序没有崩溃,因此很难确定问题所在。
I'd like to set a breakpoint on _WebThreadLockFromAnyThread
, but when I try to set a symbolic breakpoint using:
我想在_WebThreadLockFromAnyThread上设置断点,但是当我尝试使用以下方法设置符号断点时:
b _WebThreadLockFromAnyThread
the debugger tells me:
调试器告诉我:
breakpoint set --name '_WebThreadLockFromAnyThread' Breakpoint created: 12: name = '_WebThreadLockFromAnyThread', locations = 0 (pending) WARNING: Unable to resolve breakpoint to any actual locations.
断点集--name'_WebThreadLockFromAnyThread'创建的断点:12:name ='_ WebThreadLockFromAnyThread',locations = 0(pending)警告:无法解析任何实际位置的断点。
I've also tried creating the symbolic breakpoint using the UI in the breakpoint navigator, but I'm not sure what to enter for the module. When I leave the module blank, the breakpoint is created but it's still not breaking when the log message appears in the debug console.
我也尝试使用断点导航器中的UI创建符号断点,但我不确定要为模块输入什么。当我将模块留空时,会创建断点,但在调试控制台中显示日志消息时它仍然没有中断。
Can anyone tell me how I can go about adding a breakpoint on _WebThreadLockFromAnyThread
, and also how I would determine what the defining module is for this symbol?
任何人都可以告诉我如何在_WebThreadLockFromAnyThread上添加断点,以及如何确定该符号的定义模块是什么?
3 个解决方案
#1
3
Just leave out the underscore. b WebThreadLockFromAnyThread works for me in both lldb and gdb. Now, this is Xcode 4.6, so if you're stuck on the older version I suppose it's possible that there's an issue in that version not present in 4.6.
只是省略下划线。 b WebThreadLockFromAnyThread在lldb和gdb中都适用于我。现在,这是Xcode 4.6,所以如果你坚持使用旧版本,我想可能在4.6版本中没有出现该版本的问题。
#2
0
You can try use nm command or class-dump tool to locate the module.
您可以尝试使用nm命令或类转储工具来定位模块。
#3
0
Most likely there are no symbols you need because xcode by default produces a "release" build which if I am correct strips the symbols making the exec file much smaller. I am not sure how at the moment but you need to find the option to switch to "debug" build which will guarantee to have all those lovely symbols waiting for your analysis.
很可能没有你需要的符号,因为默认情况下xcode会生成一个“release”版本,如果我正确的话,会删除使exec文件更小的符号。我不知道目前怎么样但你需要找到切换到“debug”构建的选项,这将保证所有那些可爱的符号等待你的分析。
#1
3
Just leave out the underscore. b WebThreadLockFromAnyThread works for me in both lldb and gdb. Now, this is Xcode 4.6, so if you're stuck on the older version I suppose it's possible that there's an issue in that version not present in 4.6.
只是省略下划线。 b WebThreadLockFromAnyThread在lldb和gdb中都适用于我。现在,这是Xcode 4.6,所以如果你坚持使用旧版本,我想可能在4.6版本中没有出现该版本的问题。
#2
0
You can try use nm command or class-dump tool to locate the module.
您可以尝试使用nm命令或类转储工具来定位模块。
#3
0
Most likely there are no symbols you need because xcode by default produces a "release" build which if I am correct strips the symbols making the exec file much smaller. I am not sure how at the moment but you need to find the option to switch to "debug" build which will guarantee to have all those lovely symbols waiting for your analysis.
很可能没有你需要的符号,因为默认情况下xcode会生成一个“release”版本,如果我正确的话,会删除使exec文件更小的符号。我不知道目前怎么样但你需要找到切换到“debug”构建的选项,这将保证所有那些可爱的符号等待你的分析。