0
我想LLDB調試時知道互斥鎖的主人,我在網上查的是GDB可以打印線程ID喜歡https://en.wikibooks.org/wiki/Linux_Applications_Debugging_Techniques/Deadlockslldb如何檢查互斥鎖的主人?
然而,當我嘗試這LLDB,裏面互斥成員變量是不透明的,如:
Process 76057 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00000001000017f5 a.out`main at lol2.cc:65
62 }
63 std::cout << "main thread notify start" << std::endl;
64 std::this_thread::sleep_for(std::chrono::seconds(1));
-> 65 start = true;
66 cv.notify_all();
67 {
68 std::unique_lock<std::mutex> lk(mu1);
(lldb) p mu1
(mutex) $0 = {
__mutex_base = {
_M_mutex = (__sig = 1297437786, __opaque = char [56] @ 0x00007fc614127698)
}
}
(lldb)
有沒有什麼辦法可以得到不透明部分的內容?謝謝。