gdb
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | gdb [2016/10/17 10:01] – dblume | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== gdb ====== | ||
+ | Show all the backtraces: | ||
+ | |||
+ | (gdb) set pagination off | ||
+ | (gdb) thread apply all bt | ||
+ | |||
+ | Other useful tips: | ||
+ | |||
+ | (gdb) t a a f # thread apply all frame | ||
+ | (gdb) t a a bt 3 # thread apply all backtrace bottom three frames | ||
+ | (gdb) t a a bt -3 # thread apply all backtrace top three frames | ||
+ | |||
+ | ==== Detecting a Deadlock ==== | ||
+ | |||
+ | Get high level info on the threads: | ||
+ | |||
+ | (gdb) info threads | ||
+ | Id | ||
+ | * 3 Thread 0x76c9d450 (LWP 24793) " | ||
+ | 2 Thread 0x7649d450 (LWP 24794) " | ||
+ | 1 Thread 0x76fdd000 (LWP 24792) " | ||
+ | |||
+ | Make notes of those Thread IDs at LWP, and choose the thread you want, and choose a stack frame that shows the mutex of interest. | ||
+ | |||
+ | (gdb) thread 3 | ||
+ | | ||
+ | # | ||
+ | | ||
+ | (gdb) bt | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | ... | ||
+ | #10 0x0001b37c in std:: | ||
+ | #11 0x76f54348 in ?? () from / | ||
+ | | ||
+ | (gdb) f 4 | ||
+ | # | ||
+ | | ||
+ | (gdb) info args | ||
+ | this = 0x76c9cd9c | ||
+ | __m = @0x3147c: {< | ||
+ | |||
+ | Note the < | ||
+ | |||
+ | (gdb) t 2 | ||
+ | (gdb) bt | ||
+ | (gdb) f 3 | ||
+ | (gdb) p *this | ||
+ | $8 = {< | ||
+ | |||
+ | Note the < |
gdb.txt · Last modified: 2023/04/12 20:44 by 127.0.0.1