How can I debug mutex issues on Mac OS X?

最后都变了- 提交于 2019-12-10 14:56:56

问题


I am trying to get a gdb/lldb stub to work for a program I'm making, and right now it seems to deadlock the debugger, so I am (ironically) debugging lldb on my machine to try to figure out where things go wrong.

lldb is trying to lock a mutex and seems to deadlock on that.

On Windows, I know that you can use WinDBG magic in kernel debugging mode to figure out who acquired the mutex first, and on Linux I know that pthread_mutex_t isn't opaque and you can use it to figure out which thread is holding it very simply.

What about Mac OS X? What can I do if I want to know which thread owns a mutex?

For the record, I've tried searching opensource.apple.com for the actual definition of the mutex structure, without much luck, but it doesn't mean it's not there.

来源:https://stackoverflow.com/questions/18387048/how-can-i-debug-mutex-issues-on-mac-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!