I am looking to understand what is the state of a specific thread in my software, doing it from another thread. Specifically I'd like to know if it's I/O stuck. I was thinking of doing it by getting the backtrace(unless someone has another idea?), since I know what function it's supposed to be stuck on.. but I can't figure out how to get the backtrace of that specific thread, without calling the SEGFAULT handler... but gdb is able to do it(I doubt he creates SEGFAULTS..)
Can anyone help? any idea?
[Edit] all 3 answers refer to gdb, I KNOW I can do it from gdb, I wanted to know how to do it from a software(even linking to gdb libs somehow would be an answer, but how ? )