To do this automatically for your project in XCode:
In Xcode, Option-Command-B to open the Breakpoints window (or Run>Show>Breakpoints).
Where it says "Double-Click for Symbol", double click... and paste in "_NSLockError".
Click anywhere else in the window, and your new entry will automatically be updated (or just add it manually) with Module = "Foundation" (without the quotes)
Build & Go and you will now drop into the debugger automatically when you hit an automatically-detected deadlock.