Search code examples
c++debugginglldb

How to list in which function each thread is at with lldb?


I'm trying to debug a multithreaded function, and there are lots of threads that execute functions that take some time. The program works for a while and then hangs. I'd like to know what each thread is doing when this happens, to know which part of the code is hanging.

Is it possible with lldb?


Solution

  • You can run thread backtrace all to list the stack for all threads. This command takes a -c/--count flag, which you can use to limit the output to the top frames. For example to see only the current function of each thread, run thread backtrace -c 1 all.