anancds / document

MIT License
1 stars 0 forks source link

gdb查看死锁 #143

Open anancds opened 4 years ago

anancds commented 4 years ago

gdb attach pid thread apply all bt

anancds commented 4 years ago

(gdb) print AccountA_mutex $1 = {m_reserved = 2, __m_count = 0, m_owner = 0x2527, m_kind = 0, __m_lock = {status = 1, spinlock = 0}} (gdb) print 0x2527 $2 = 9511 (gdb) print AccountB_mutex $3 = {__m_reserved = 2, m_count = 0, m_owner = 0x2529, __m_kind = 0, m_lock = {status = 1, spinlock = 0}} (gdb) print 0x2529 $4 = 9513

anancds commented 4 years ago

thread id切换到线程去查看相关信息

anancds commented 3 years ago

set logging file mylog.txt set logging on